Skip to content

Commit 44dc5f3

Browse files
committed
one file to publish them all
1 parent 009cf76 commit 44dc5f3

3 files changed

Lines changed: 13 additions & 116 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ jobs:
9696

9797
# Release RC version on NPM for Hive libraries
9898
release-candidate:
99-
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@v1
99+
uses: ./.github/workflows/release-npm.yaml
100100
if: ${{ github.event.pull_request.title == 'Upcoming Release Changes' }}
101101
with:
102+
type: snapshot
102103
npmTag: rc
103104
restoreDeletedChangesets: true
104-
buildScript: build:libraries
105-
node-version-file: '.node-version'
106105
secrets:
107106
githubToken: ${{ secrets.GITHUB_TOKEN }}
108107
npmToken: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-alpha.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
on:
22
workflow_call:
33

4-
permissions:
5-
id-token: write
6-
pull-requests: write
7-
contents: write
8-
94
jobs:
105
# Release alpha version on NPM for Hive libraries
116
npm:
12-
uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@v1
13-
permissions:
14-
pull-requests: write
15-
actions: write
16-
contents: write
7+
uses: ./.github/workflows/release-npm.yaml
178
with:
9+
type: snapshot
1810
npmTag: alpha
19-
buildScript: build:libraries
20-
node-version-file: '.node-version'
2111
secrets:
2212
githubToken: ${{ secrets.GITHUB_TOKEN }}
2313
npmToken: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-stable.yaml

Lines changed: 9 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -16,104 +16,12 @@ on:
1616

1717
jobs:
1818
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

Comments
 (0)