Skip to content

Release Action

Release Action #10

Workflow file for this run

name: Release Action
on:
workflow_dispatch:
inputs:
ref:
description: 'Ref'
required: true
default: 'main'
version:
description: 'Version'
required: true
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Create Release
uses: actions/github-script@v7
env:
INPUT_REF: ${{ inputs.ref }}
INPUT_VERSION: ${{ inputs.version }}
with:
script: |
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: 'v' + core.getInput('version'),
target_commitish: core.getInput('ref'),
})
- name: Move Major Version Tag
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
# move the major version tag e.g. v1
MAJOR_INPUT_VERSION="${INPUT_VERSION%%.*}"
MAJOR_VERSION_TAG="v${MAJOR_INPUT_VERSION}"
git tag --force "${MAJOR_VERSION_TAG}"
git push --force origin "${MAJOR_VERSION_TAG}"