Publish Stable #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Stable | |
on: | |
workflow_dispatch: | |
# Wait for the workflow to finish before starting a new one | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release-stable: | |
# Only allow on master branch | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: ubuntu-latest | |
# More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings | |
permissions: | |
contents: write | |
pull-requests: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.6.10 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.16.0 | |
registry-url: https://registry.npmjs.org/ | |
cache: 'pnpm' | |
- name: Git config | |
run: | | |
git config user.name "bclabum" | |
git config user.email "blockchain-lab@um.si" | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.BCLABUM_PGP }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Set deployment token | |
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
# Makes a pr to publish the changesets (when merged will publish to npm) | |
# see https://github.com/changesets/action | |
- name: Publish To NPM or Create Release Pull Request | |
uses: martines3000/changeset-action@v1.5.0 | |
id: changesets | |
with: | |
publish: bash scripts/changesets/publish-stable.sh | |
title: 'chore: version packages' | |
commit: 'chore: version packages' | |
forcePublish: true | |
setupGitUser: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.BCLABUM_GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} |