Skip to content

Commit 8a90200

Browse files
authored
Merge pull request #26 from qupath/release-from-tag
Create draft release when v* (eg v0.1.0) tag is pushed
2 parents 3129e77 + 5f3b1d9 commit 8a90200

File tree

2 files changed

+39
-14
lines changed

2 files changed

+39
-14
lines changed

.github/workflows/gradle.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
51
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
62
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
73

@@ -14,29 +10,28 @@ on:
1410
branches: [ "main" ]
1511
workflow_dispatch:
1612

17-
permissions:
18-
contents: read
19-
2013
jobs:
2114
build:
22-
2315
runs-on: ubuntu-latest
24-
2516
steps:
26-
- uses: actions/checkout@v3
17+
- name: Checkout
18+
uses: actions/checkout@v3
2719
- name: Set up JDK 11
2820
uses: actions/setup-java@v3
2921
with:
3022
java-version: '11'
3123
distribution: 'temurin'
3224
- name: Validate Gradle wrapper
33-
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
25+
uses: gradle/wrapper-validation-action@v1.1.0
3426
- name: Build with Gradle
35-
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
27+
uses: gradle/gradle-build-action@v2.7.1
3628
with:
3729
arguments: build
38-
- uses: actions/upload-artifact@v3
30+
- name: Upload artifacts
31+
uses: actions/upload-artifact@v3
3932
with:
40-
name: jar
33+
name: ${{ github.event.repository.name }}-${{ github.event.pull_request && github.head_ref || github.ref_name }}
4134
path: build/libs
4235
retention-days: 7
36+
37+

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Make draft release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
permissions:
11+
contents: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: '11'
20+
distribution: 'temurin'
21+
- name: Validate Gradle wrapper
22+
uses: gradle/[email protected]
23+
- name: Build with Gradle
24+
uses: gradle/[email protected]
25+
with:
26+
arguments: build
27+
- name: Release
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
run: gh release create --draft ${{ github.ref_name }} --title ${{ github.ref_name }} build/libs/*

0 commit comments

Comments
 (0)