|
1 | | -name: Release Packages |
| 1 | +name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - branches: |
6 | | - - main |
7 | 4 | 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 |
20 | 12 |
|
21 | 13 | env: |
| 14 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
22 | 15 | NX_NON_NATIVE_HASHER: true |
23 | 16 | NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} |
24 | 17 |
|
25 | 18 | 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 |
48 | 19 | 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 |
55 | 21 | runs-on: ubuntu-latest |
56 | | - permissions: |
57 | | - contents: write |
58 | 22 | 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 |
66 | 24 | uses: actions/checkout@v4 |
67 | 25 | with: |
68 | 26 | 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 |
71 | 29 | 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 |
74 | 32 | - name: Set up Node.js |
75 | 33 | uses: actions/setup-node@v4 |
76 | 34 | with: |
|
79 | 37 | - name: Install dependencies |
80 | 38 | run: npm ci |
81 | 39 | - 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