Skip to content

Commit ecdf223

Browse files
committed
ci: automated releases.
1 parent b6e75e6 commit ecdf223

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/build-test-gumtree.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build, Test and Deploy GumTree
33
on:
44
push:
55
branches: [ main ]
6+
tags:
7+
- 'v*'
68
pull_request:
79
branches: [ main ]
810

@@ -14,6 +16,10 @@ jobs:
1416
steps:
1517
- name: checkout gumtree
1618
uses: actions/checkout@v2
19+
- name: retrieve gumtree version
20+
id: version
21+
run: echo "::set-output name=version::$(cat build.gradle | grep "version =" | cut -f 2 -d "'")"
22+
shell: bash
1723
- name: build gumtree
1824
run: ./gradlew build
1925
- name: upload defects4j results
@@ -29,7 +35,19 @@ jobs:
2935
name: coverage-report
3036
path: build/reports/jacoco/jacocoRootReport/html/
3137
- name: upload snapshot package
32-
if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, '[snapshot]') }}
38+
if: ${{ github.event_name == 'push' && contains(steps.version.outputs.version, 'SNAPSHOT') }}
3339
run: ./gradlew publish
3440
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
- name: upload release package
43+
if: ${{ github.event_name == 'push' && !contains(steps.version.outputs.version, 'SNAPSHOT') && endsWith(github.ref, steps.version.outputs.version) }}
44+
run: ./gradlew publish
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
- name: create github release
48+
if: ${{ github.event_name == 'push' && !contains(steps.version.outputs.version, 'SNAPSHOT') && endsWith(github.ref, steps.version.outputs.version) }}
49+
uses: ncipollo/release-action@v1
50+
with:
51+
artifacts: "dist/build/distributions/gumtree*.zip"
52+
bodyFile: "CHANGELOG.md"
53+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)