console/.github/workflows/release-stable.yaml
2023-07-17 17:19:08 +02:00

76 lines
2.4 KiB
YAML

on:
workflow_call:
jobs:
publish:
runs-on: ubuntu-22.04
env:
HIVE_TOKEN: ${{ secrets.HIVE_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: setup environment
uses: ./.github/actions/setup
with:
codegen: false # no need to run because release script will run it anyway
actor: release-stable
cacheNext: false
cacheTurbo: true
- name: prepare npm credentials
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> $HOME/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: publish stable
id: changesets
uses: changesets/action@v1.4.5
with:
publish: pnpm release
commit: 'chore(release): update monorepo packages versions'
title: 'Upcoming Release Changes'
env:
GITHUB_TOKEN: ${{ secrets.GUILD_BOT_TOKEN }}
- name: extract published 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 --win || pnpm oclif
promote --no-xz --sha ${GITHUB_SHA:0:8} --version $VERSION --win