-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (44 loc) · 1.68 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Release
run-name: Release ${{ inputs.releaseVersion }} by ${{ github.actor }}
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "The release version in <MAJOR>.<MINOR>.<PATCH> format"
required: true
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: "Check release version"
run: |
expr "${{ github.event.inputs.releaseVersion }}" : '\(^[1-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\(-beta\.[1-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: 14
- name: "Set release version"
run: |
npx replace-in-file --isRegex=true '/"version":\s*".+"/g' '"version": "${{ github.event.inputs.releaseVersion }}"' 'package.json'
- name: "Commit release version and create tag"
run: |
git add -A
git commit -am "release ${{ github.event.inputs.releaseVersion }}"
git tag v${{ github.event.inputs.releaseVersion }}
git push origin v${{ 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 }}