-
Notifications
You must be signed in to change notification settings - Fork 227
57 lines (54 loc) · 2.27 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
53
54
55
56
57
name: Release
run-name: Release ${{ inputs.releaseVersion }} (next ${{ inputs.nextVersion }}) by ${{ github.actor }}
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "The release version in <MAJOR>.<MINOR>.<PATCH> format"
required: true
nextVersion:
description: "The next version in <MAJOR>.<MINOR> format WITHOUT SNAPSHOT SUFFIX"
required: true
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: "Check release version"
run: |
expr "${{ github.event.inputs.releaseVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$'
- name: "Check next version"
run: |
expr "${{ github.event.inputs.nextVersion }}" : '[[:digit:]][[:digit:]]*\.[[:digit:]][[:digit:]]*$'
- uses: actions/[email protected]
with:
token: ${{ secrets.QAMETA_CI }}
- name: "Configure CI Git User"
run: |
git config --global user.name qameta-ci
git config --global user.email [email protected]
- name: "Set release version"
run: |
sed -i -e '/version=/s/.*/version=${{ github.event.inputs.releaseVersion }}/g' gradle.properties
cat gradle.properties
- name: "Commit release version and create tag"
run: |
git commit -am "release ${{ github.event.inputs.releaseVersion }}"
git tag ${{ github.event.inputs.releaseVersion }}
git push origin ${{ github.event.inputs.releaseVersion }}
- name: "Set next development version"
run: |
sed -i -e '/version=/s/.*/version=${{ github.event.inputs.nextVersion }}-SNAPSHOT/g' gradle.properties
cat gradle.properties
- name: "Commit next development version and push it"
run: |
git commit -am "set next development version ${{ github.event.inputs.nextVersion }}"
git push origin ${{ github.ref }}
- name: "Publish Github Release"
uses: octokit/[email protected]
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 }}