Release v0.3.8 (#129) #13
Workflow file for this run
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: Publish | |
on: | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
permissions: read-all | |
jobs: | |
release-branch: | |
name: Release branch | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write # To push a branch update | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
with: | |
fetch-depth: 0 | |
- name: Get version | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | |
id: version | |
with: | |
result-encoding: string | |
script: | | |
const ref = context.ref | |
const tag = ref.replace(/^refs\/tags\//, "") | |
return tag | |
- name: Get major version | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | |
id: major_version | |
env: | |
VERSION: ${{ steps.version.outputs.result }} | |
with: | |
result-encoding: string | |
script: | | |
const tag = `${process.env.VERSION}` | |
const majorVersion = tag.split(".")[0] | |
return majorVersion | |
- name: Update major version branch | |
env: | |
MAJOR_VERSION: ${{ steps.major_version.outputs.result }} | |
run: | | |
git push origin "HEAD:${MAJOR_VERSION}" --force | |
github: | |
name: GitHub Release | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write # To create a GitHub Release | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- name: Get version | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | |
id: version | |
with: | |
result-encoding: string | |
script: | | |
const ref = context.ref | |
const tag = ref.replace(/^refs\/tags\//, "") | |
return tag | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 | |
with: | |
name: Release ${{ steps.version.outputs.result }} | |
body: Release ${{ steps.version.outputs.result }} | |
tag: ${{ steps.version.outputs.result }} | |
draft: false | |
makeLatest: true | |
prerelease: false |