Skip to content

Commit fd6b5e7

Browse files
committed
ci: simplify release workflow
1 parent 3a1e2f6 commit fd6b5e7

File tree

1 file changed

+18
-73
lines changed

1 file changed

+18
-73
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,34 @@
1-
name: Release Packages
1+
name: Release
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
74
push:
8-
branches:
9-
- main
10-
workflow_dispatch:
11-
inputs:
12-
dryRun:
13-
type: choice
14-
description: 'Dry run'
15-
required: true
16-
default: 'false'
17-
options:
18-
- 'true'
19-
- 'false'
5+
# TODO
6+
# branches:
7+
# - main
8+
9+
permissions:
10+
contents: write
11+
id-token: write
2012

2113
env:
14+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2215
NX_NON_NATIVE_HASHER: true
2316
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
2417

2518
jobs:
26-
dry-run-release:
27-
if: |
28-
github.repository == 'code-pushup/cli' && (
29-
github.event_name == 'pull_request' ||
30-
(github.event_name == 'workflow_dispatch' && github.event.inputs.dryRun == 'true')
31-
)
32-
name: Dry run release
33-
runs-on: ubuntu-latest
34-
steps:
35-
- name: Checkout the repository
36-
uses: actions/checkout@v4
37-
with:
38-
fetch-depth: 0
39-
- name: Set up Node.js
40-
uses: actions/setup-node@v4
41-
with:
42-
node-version-file: .node-version
43-
cache: npm
44-
- name: Install dependencies
45-
run: npm ci
46-
- name: Version, release and publish packages
47-
run: npx nx release --yes --dry-run
4819
release:
49-
if: |
50-
github.repository == 'code-pushup/cli' && (
51-
(github.event_name == 'workflow_dispatch' && github.event.inputs.dryRun == 'false') ||
52-
(github.event_name == 'push')
53-
)
54-
name: Release packages
20+
name: Publish packages
5521
runs-on: ubuntu-latest
56-
permissions:
57-
contents: write
5822
steps:
59-
- name: Generate a token
60-
id: generate_token
61-
uses: actions/create-github-app-token@v1
62-
with:
63-
app-id: ${{ secrets.GH_APP_ID }}
64-
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
65-
- name: Checkout the repository
23+
- name: Clone the repository
6624
uses: actions/checkout@v4
6725
with:
6826
fetch-depth: 0
69-
token: ${{ steps.generate_token.outputs.token }}
70-
- name: Set up Git
27+
- name: Configure Git user
28+
# https://github.com/actions/checkout/blob/main/README.md#push-a-commit-using-the-built-in-token
7129
run: |
72-
git config user.name github-actions
73-
git config user.email github-actions@github.com
30+
git config user.name github-actions[bot]
31+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
7432
- name: Set up Node.js
7533
uses: actions/setup-node@v4
7634
with:
@@ -79,19 +37,6 @@ jobs:
7937
- name: Install dependencies
8038
run: npm ci
8139
- name: Version, release and publish packages
82-
env:
83-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
84-
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
85-
run: |
86-
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
87-
npx nx release --yes
88-
git push --follow-tags
89-
- name: Run Code PushUp on release commit
90-
uses: code-pushup/github-action@v0
91-
with:
92-
bin: npx nx code-pushup --
93-
env:
94-
CP_SERVER: ${{ secrets.CP_SERVER }}
95-
CP_API_KEY: ${{ secrets.CP_API_KEY }}
96-
CP_ORGANIZATION: code-pushup
97-
CP_PROJECT: cli
40+
# TODO
41+
# run: npx nx release --yes
42+
run: npx nx release --yes 0.79.2-alpha.1

0 commit comments

Comments
 (0)