Repository navigation
72 lines (66 loc) · 2.82 KB
/
Copy pathrelease.yml
File metadata and controls
72 lines (66 loc) · 2.82 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
permissions:
contents: read
jobs:
triage:
runs-on: ubuntu-latest
env:
GIT_COMMIT_AUTHOR_EMAIL: ${{ vars.ALLURE_CI_APP_USER_ID }}+${{ vars.ALLURE_CI_APP_SLUG }}[bot]@users.noreply.github.com
GIT_COMMIT_AUTHOR_NAME: ${{ vars.ALLURE_CI_APP_SLUG }}[bot]
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:]]*$'
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.ALLURE_CI_APP_CLIENT_ID }}
private-key: ${{ secrets.ALLURE_CI_APP_PRIVATE_KEY }}
permission-contents: write
- uses: actions/checkout@v7
with:
token: ${{ steps.app-token.outputs.token }}
- name: "Configure CI Git User"
run: |
git config --global user.name "${GIT_COMMIT_AUTHOR_NAME}"
git config --global user.email "${GIT_COMMIT_AUTHOR_EMAIL}"
- 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/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: ${{ steps.app-token.outputs.token }}