Skip to content

apply-version-and-tag #24

apply-version-and-tag

apply-version-and-tag #24

name: apply-version-and-tag
on:
workflow_run:
workflows:
- tests
types:
- completed
branches:
- master
jobs:
validate-changelog-structure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup
uses: ./.github/actions/setup
- name: Validate structure
run: npx tsx scripts/release/validate-changelog.cts
apply-version-and-tag:
name: Apply version and tag
runs-on: ubuntu-latest
needs: validate-changelog-structure
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- id: apply
name: Compute and apply next version
uses: actions/github-script@v7
with:
script: |
require('ts-node/register/transpile-only');
await require('./scripts/release/apply-release.cts').default(core);
- name: Update package-lock
run: npm install --package-lock-only
- run: bash scripts/git-user-config.sh
- name: Commit version bump and changelog update
if: steps.apply.outputs.skip != 'true'
run: |
git remote set-url origin git@github.com:dl-solarity/solidity-lib.git
eval "$(ssh-agent -s)"
ssh-add - <<< "${{ secrets.COMMIT_RELEASER }}"
git add package.json package-lock.json CHANGELOG.md
if ! git diff --cached --quiet; then
git commit -m "chore(release): v${{ steps.apply.outputs.version }}"
git tag v${{ steps.apply.outputs.version }}
git push origin
git push origin --tags
fi