Skip to content

Commit

Permalink
Merge pull request #26 from qupath/release-from-tag
Browse files Browse the repository at this point in the history
Create draft release when v* (eg v0.1.0) tag is pushed
  • Loading branch information
petebankhead authored Aug 23, 2023
2 parents 3129e77 + 5f3b1d9 commit 8a90200
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

Expand All @@ -14,29 +10,28 @@ on:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@v1.1.0
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
uses: gradle/gradle-build-action@v2.7.1
with:
arguments: build
- uses: actions/upload-artifact@v3
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: jar
name: ${{ github.event.repository.name }}-${{ github.event.pull_request && github.head_ref || github.ref_name }}
path: build/libs
retention-days: 7


30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Make draft release

on:
push:
tags: ["v*"]
workflow_dispatch:

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/[email protected]
- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: build
- name: Release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create --draft ${{ github.ref_name }} --title ${{ github.ref_name }} build/libs/*

0 comments on commit 8a90200

Please sign in to comment.