Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jceval committed Aug 26, 2024
1 parent 1385351 commit c75534a
Showing 1 changed file with 47 additions and 15 deletions.
62 changes: 47 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,60 @@
name: Release
name: Tag and Release

on:
push:
branches:
- 'release/*'
- main
- release/*
workflow_dispatch:

jobs:
release:
name: Release
TagStage:
name: Bump Git Tag with Semverbot
runs-on: ubuntu-latest

defaults:
run:
working-directory: ${{ github.workspace }}

steps:
- name: Checkout code
- name: Checkout Source Repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
repository: ${{ github.repository }}
ref: ${{ github.ref }}
persist-credentials: true

- name: Set up Git
run: |
git config --global user.name 'semverbot'
git config --global user.email '[email protected]'
- name: Bump Git Tag to Next Version
run: |
semverbot bump \
--working-directory "${{ github.workspace }}" \
--config-file "${{ github.workspace }}/template-repo/src/pipelines/shared/config/semverbot-config.toml" \
--branch "${{ github.ref_name }}" \
--git-user-email "[email protected]" \
--git-user-name "semverbot"
- name: Install dependencies
run: npm install
- name: Add Current and Next Version Tags
run: |
echo "::set-output name=current_version::$(semverbot predict --current)"
echo "::set-output name=next_version::$(semverbot predict --next)"
- name: Push New Tag to Repository
run: |
git push origin --tags
- name: Add Tags as Build Metadata
uses: actions/github-script@v6
with:
script: |
const currentVersion = '${{ steps.BumpGitTag.outputs.current_version }}';
const nextVersion = '${{ steps.BumpGitTag.outputs.next_version }}';
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
core.setOutput('current_version', currentVersion);
core.setOutput('next_version', nextVersion);
core.info(`Current version: ${currentVersion}`);
core.info(`Next version: ${nextVersion}`);

0 comments on commit c75534a

Please sign in to comment.