-
Notifications
You must be signed in to change notification settings - Fork 101
111 lines (95 loc) · 3.7 KB
/
release-stable.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
on:
workflow_call:
jobs:
publish:
runs-on: ubuntu-22.04
env:
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}
# AWS_* are used by Oclif CLI
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_S3_ENDPOINT: https://6d5bc18cd8d13babe7ed321adba3d8ae.r2.cloudflarestorage.com
outputs:
publish: ${{ steps.cli.outputs.publish }}
version: ${{ steps.cli.outputs.version }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
token: ${{ secrets.GUILD_BOT_TOKEN }}
- name: setup environment
uses: ./.github/actions/setup
with:
codegen: false # no need to run because release script will run it anyway
actor: release-stable
cacheTurbo: true
- name: prepare npm credentials
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> $HOME/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: publish stable
id: changesets
uses: changesets/action@v1.4.9
with:
publish: pnpm release
version: pnpm release:version
commit: 'chore(release): update monorepo packages versions'
title: 'Upcoming Release Changes'
env:
GITHUB_TOKEN: ${{ secrets.GUILD_BOT_TOKEN }}
- name: extract published cli version
if:
steps.changesets.outputs.published && contains(steps.changesets.outputs.publishedPackages,
'"@graphql-hive/cli"')
id: cli
run: |
echo '${{steps.changesets.outputs.publishedPackages}}' > cli-ver.json
VERSION=`echo $(jq -r '.[] | select(.name | endswith("@graphql-hive/cli")).version' cli-ver.json)`
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "publish=true" >> $GITHUB_OUTPUT
# Needed for `oclif pack win`
- name: Install NSIS
run: |
sudo apt-get -y install nsis
- name: pack tarballs
if: steps.cli.outputs.publish == 'true'
working-directory: packages/libraries/cli
run: pnpm oclif:pack
- name: upload tarballs
if: steps.cli.outputs.publish == 'true'
working-directory: packages/libraries/cli
run: pnpm oclif:upload
- name: promote tarballs
if: steps.cli.outputs.publish == 'true'
working-directory: packages/libraries/cli
env:
VERSION: ${{ steps.cli.outputs.version }}
run: pnpm oclif promote --no-xz --sha ${GITHUB_SHA:0:7} --version $VERSION
- name: extract published Crate version
id: rust-crate
if:
steps.changesets.outputs.published && contains(steps.changesets.outputs.publishedPackages,
'"hive-apollo-router-plugin"')
run: |
echo '${{steps.changesets.outputs.publishedPackages}}' > published.json
VERSION=`echo $(jq -r '.[] | select(.name | endswith("hive-apollo-router-plugin")).version' published.json)`
echo "crate_version=$VERSION" >> $GITHUB_OUTPUT
echo "crate_publish=true" >> $GITHUB_OUTPUT
- name: release hive-apollo-router-plugin to Crates.io
if: steps.rust-crate.outputs.crate_publish == 'true'
run: |
cd packages/libraries/router
cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish --allow-dirty --no-verify
publish_docker_cli:
needs: [publish]
uses: ./.github/workflows/dockerize-cli.yaml
if: ${{ needs.publish.outputs.publish == 'true' }}
with:
cliVersion: ${{ needs.publish.outputs.version }}
secrets: inherit