|
16 | 16 |
|
17 | 17 | jobs: |
18 | 18 | publish: |
19 | | - runs-on: ubuntu-22.04 |
20 | | - permissions: |
21 | | - pull-requests: write |
22 | | - actions: write |
23 | | - contents: write |
24 | | - env: |
25 | | - HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }} |
26 | | - # AWS_* are used by Oclif CLI |
27 | | - AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} |
28 | | - AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} |
29 | | - AWS_S3_ENDPOINT: https://6d5bc18cd8d13babe7ed321adba3d8ae.r2.cloudflarestorage.com |
30 | | - |
31 | | - outputs: |
32 | | - cliPublish: ${{ steps.cli.outputs.publish }} |
33 | | - cliVersion: ${{ steps.cli.outputs.version }} |
34 | | - hivePublish: ${{ steps.hive.outputs.publish }} |
35 | | - hiveVersion: ${{ steps.hive.outputs.version }} |
36 | | - |
37 | | - steps: |
38 | | - - name: checkout |
39 | | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
40 | | - with: |
41 | | - fetch-depth: 2 |
42 | | - token: ${{ secrets.BOT_GITHUB_TOKEN }} |
43 | | - |
44 | | - - name: setup environment |
45 | | - uses: ./.github/actions/setup |
46 | | - with: |
47 | | - codegen: false # no need to run because release script will run it anyway |
48 | | - actor: release-stable |
49 | | - |
50 | | - - name: prepare npm credentials |
51 | | - run: | |
52 | | - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> $HOME/.npmrc |
53 | | - env: |
54 | | - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
55 | | - |
56 | | - - uses: dtolnay/rust-toolchain@stable |
57 | | - with: |
58 | | - toolchain: stable |
59 | | - |
60 | | - # see https://github.com/changesets/action/issues/523 |
61 | | - - name: fix gh-api issues with changesets |
62 | | - run: | |
63 | | - git ls-files | while read -r file; do [ -x "$file" ] && chmod -x "$file" || true; done |
64 | | -
|
65 | | - - name: publish stable |
66 | | - id: changesets |
67 | | - uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3 |
68 | | - with: |
69 | | - publish: pnpm release |
70 | | - version: pnpm release:version |
71 | | - commit: 'chore(release): update monorepo packages versions' |
72 | | - title: 'Upcoming Release Changes' |
73 | | - commitMode: github-api |
74 | | - env: |
75 | | - GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} |
76 | | - |
77 | | - - name: extract published cli version |
78 | | - if: |
79 | | - steps.changesets.outputs.published && contains(steps.changesets.outputs.publishedPackages, |
80 | | - '"@graphql-hive/cli"') |
81 | | - id: cli |
82 | | - run: | |
83 | | - echo '${{steps.changesets.outputs.publishedPackages}}' > cli-ver.json |
84 | | - VERSION=`echo $(jq -r '.[] | select(.name | endswith("@graphql-hive/cli")).version' cli-ver.json)` |
85 | | - echo "version=$VERSION" >> $GITHUB_OUTPUT |
86 | | - echo "publish=true" >> $GITHUB_OUTPUT |
87 | | -
|
88 | | - - name: extract published hive version |
89 | | - if: |
90 | | - steps.changesets.outputs.published && contains(steps.changesets.outputs.publishedPackages, |
91 | | - '"hive"') |
92 | | - id: hive |
93 | | - run: | |
94 | | - echo '${{steps.changesets.outputs.publishedPackages}}' > hive-ver.json |
95 | | - VERSION=`echo $(jq -r '.[] | select(.name | endswith("hive")).version' hive-ver.json)` |
96 | | - echo "hiveVersion=$VERSION" >> $GITHUB_OUTPUT |
97 | | - echo "hivePublish=true" >> $GITHUB_OUTPUT |
98 | | -
|
99 | | - # Needed for `oclif pack win` |
100 | | - - name: Install NSIS |
101 | | - run: | |
102 | | - sudo apt-get -y install nsis |
103 | | -
|
104 | | - - name: pack tarballs |
105 | | - if: steps.cli.outputs.publish == 'true' |
106 | | - working-directory: packages/libraries/cli |
107 | | - run: pnpm oclif:pack |
108 | | - |
109 | | - - name: upload tarballs |
110 | | - if: steps.cli.outputs.publish == 'true' |
111 | | - working-directory: packages/libraries/cli |
112 | | - run: pnpm oclif:upload |
113 | | - |
114 | | - - name: promote tarballs |
115 | | - if: steps.cli.outputs.publish == 'true' |
116 | | - working-directory: packages/libraries/cli |
117 | | - env: |
118 | | - VERSION: ${{ steps.cli.outputs.version }} |
119 | | - run: pnpm oclif promote --no-xz --sha ${GITHUB_SHA:0:7} --version $VERSION |
| 19 | + uses: ./.github/workflows/release-npm.yaml |
| 20 | + with: |
| 21 | + type: stable |
| 22 | + secrets: |
| 23 | + githubToken: ${{ secrets.BOT_GITHUB_TOKEN }} |
| 24 | + npmToken: ${{ secrets.NPM_TOKEN }} |
| 25 | + hiveToken: ${{ secrets.HIVE_TOKEN }} |
| 26 | + r2AccessKeyId: ${{ secrets.R2_ACCESS_KEY_ID }} |
| 27 | + r2SecretAccessKey: ${{ secrets.R2_SECRET_ACCESS_KEY }} |
0 commit comments