ci: use octo-sts for semantic release #82
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: Pull Request | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
code-validation: | |
uses: ./.github/workflows/code_validation.yml | |
release-dry-run: | |
name: Release Dry Run | |
needs: [code-validation] | |
runs-on: ubuntu-latest | |
concurrency: release | |
permissions: | |
id-token: write | |
contents: write | |
issues: write | |
pull-requests: write | |
packages: write | |
env: | |
HUSKY: 0 | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "yarn" | |
- name: Install dependencies | |
run: | | |
yarn install | |
- name: Build Typescript Definitions | |
run: | | |
yarn tsc | |
- name: Build | |
run: | | |
yarn build | |
- uses: octo-sts/action@6177b4481c00308b3839969c3eca88c96a91775f #v1.0.0 | |
id: octo-sts | |
with: | |
scope: liatrio/backstage-plugin-autogov | |
identity: semantic-release | |
- name: Bump and Release | |
env: | |
GITHUB_TOKEN: ${{ steps.octo-sts.outputs.token }} | |
SSH_KEY: ${{ secrets.DEPLOY_KEY }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
# the below line gets us locally to the result of the PR merge on the correct ref | |
git checkout -b ${{ github.base_ref }} pull/${{ github.event.number }}/merge | |
unset GITHUB_ACTIONS && npx semantic-release --dry-run --no-ci |