-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (41 loc) · 1.24 KB
/
tag.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
name: Tag
on:
push:
branches:
- develop
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.ACTIONS_COMMIT }}
- name: Recovery tag information
run: git fetch --tags --force
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 16
distribution: microsoft
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Test
run: ./gradlew test
- name: Determinate latest released tag
id: current-tag
run: echo "::set-output name=tag::$(git describe --tags --abbrev=0 --match 'v[0-9]*')";
- name: Get semver
id: semver
run: |
./gradlew generateVersionFile
echo "::set-output name=version::$(tail -1 build/semver/version.txt)"
- name: Tag
if: steps.changelog.outputs.changelog != 'No Changes'
run: |
tag=${{ steps.semver.outputs.version }}
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag "${tag}"
git push origin "${tag}"