Skip to content

[release-spm]: Version and checksum update for 2.38.0 (#132) #27

[release-spm]: Version and checksum update for 2.38.0 (#132)

[release-spm]: Version and checksum update for 2.38.0 (#132) #27

Workflow file for this run

name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Validate Release Commit
run: |
if [[ "${{ github.event.head_commit.message }}" != *"release-spm"* ]]
then
echo "Commit message does not contain 'release-spm', skipping release."
exit 1
fi
- name: Extract release version
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
id: extract-release-version
with:
result-encoding: string
script: |
const matches = `${{ github.event.head_commit.message }}`.match(/[0-9]+\.[0-9]+\.[0-9]+/) ?? []
return matches.length > 0 ? matches[0] : ""
- name: Validate Version Format
env:
RELEASE_VERSION: ${{ steps.extract-release-version.outputs.result }}
run: |
[[ ! -z "$RELEASE_VERSION" ]] || exit 1
echo "Valid release version: $RELEASE_VERSION"
- name: Create Release Tag
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
env:
RELEASE_VERSION: ${{ steps.extract-release-version.outputs.result }}
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${process.env.RELEASE_VERSION}`,
sha: context.sha
})