Skip to content

CD

CD #11

Workflow file for this run

name: CD
on:
release:
types:
- released
concurrency:
group: "stylebot"
cancel-in-progress: true
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
publish-package:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.RELEASEBOT_GITHUB_APP_ID }}
private-key: ${{ secrets.RELEASEBOT_GITHUB_APP_KEY }}
- uses: actions/checkout@master
with:
fetch-depth: 0
- run: echo "package_version=$(jq -r .version package.json)" >> $GITHUB_ENV
- if: ${{ github.event.release.name != env.package_version }}
run: 'echo "Error: Tag name does not match package.json version" && exit 1'
- id: nodeversion
run: echo "version=$(grep nodejs .tool-versions | sed -e 's/[^[:space:]]*[[:space:]]*//')" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v4
with:
node-version: ${{ steps.nodeversion.outputs.version }}
cache: yarn
registry-url: "https://registry.npmjs.org"
token: ${{ secrets.NPM_TOKEN }}
scope: "term-finance"
- run: |
cat << EOF >> .yarnrc.yml
npmScopes:
term-finance:
npmRegistryServer: https://registry.npmjs.org
npmAuthToken: ${{ secrets.NPM_TOKEN }}
npmAlwaysAuth: true
EOF
- run: yarn install --immutable
- run: yarn build:hardhat
- run: yarn build:tsc
- run: yarn npm whoami
- run: yarn npm publish --access public
- run: yarn version patch
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "[releasebot] Updates version post-release"
branch: releasebot/version-update
title: "[releasebot] Updates version post-release"
token: ${{ steps.app-token.outputs.token }}
body: |
The following files have been updated as a result of releasing version: ${{ env.package_version }}.