Skip to content

Release

Release #20

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Release version (e.g., v1.0.0)"
required: true
type: string
majorReleaseVersion:
description: "Related major release version (e.g., v1)"
required: true
type: choice
options:
- v0
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: Build and Release
steps:
- name: "Check release version"
run: |
expr "${{ github.event.inputs.releaseVersion }}" : '^v\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-beta\.[0-9][0-9]*\)\{0,1\}\)$'
- uses: actions/checkout@v4
with:
token: ${{ secrets.QAMETA_CI }}
- name: "Configure CI Git User"
run: |
git config --global user.name qameta-ci
git config --global user.email qameta-ci@qameta.io
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
- name: Build TypeScript
run: yarn build
- name: Run tests
run: yarn test
- name: "Commit release version and create tag"
run: |
git add -A
git commit -am "release ${{ github.event.inputs.releaseVersion }}" --no-verify
git tag ${{ github.event.inputs.releaseVersion }}
git push origin ${{ github.event.inputs.releaseVersion }}
git push origin ${GITHUB_REF}
- name: "Publish Github Release"
uses: octokit/request-action@v2.x
with:
route: POST /repos/${{ github.repository }}/releases
tag_name: ${{ github.event.inputs.releaseVersion }}
generate_release_notes: true
target_commitish: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.QAMETA_CI }}
- name: Tag new target
run: git tag -f ${{ github.event.inputs.majorReleaseVersion }} ${{ github.event.inputs.releaseVersion }}
- name: Push new tag
run: git push origin ${{ github.event.inputs.majorReleaseVersion }} --force