From 69c9b080f284990665be09a6bf727f1de1f2cdf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Van=C4=9Bk?= Date: Sun, 6 Feb 2022 19:28:55 +0100 Subject: [PATCH] add new release workflow --- .github/workflows/release.yml | 35 +++++++++++++++++++++++ .github/workflows/{maven.yml => test.yml} | 15 ++++------ 2 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/release.yml rename .github/workflows/{maven.yml => test.yml} (51%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c191acc4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release +on: + milestone: + types: [closed] +jobs: + build: + name: Release ${{ github.event.milestone.title }} + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: master + fetch-depth: 0 + - name: Set up Git + run: | + git config user.name "Zonky Bot" + git config user.email "bot@zonky.com" + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: 8 + server-id: ossrh + server-username: MAVEN_USER + server-password: MAVEN_PASS + gpg-private-key: ${{ secrets.SIGNING_CERT }} + gpg-passphrase: SIGNING_PASS + - name: Release with Maven + env: + RELEASE_VERSION: ${{ github.event.milestone.title }} + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_PASS: ${{ secrets.MAVEN_PASS }} + SIGNING_PASS: ${{ secrets.SIGNING_PASS }} + run: mvn -B release:prepare release:perform -DreleaseVersion=$RELEASE_VERSION \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/test.yml similarity index 51% rename from .github/workflows/maven.yml rename to .github/workflows/test.yml index 3cbd362f..dad6783a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Java CI +name: Checks on: [push, pull_request] jobs: build: @@ -9,17 +9,12 @@ jobs: java: [8, 11, 13, 14, 15] steps: - name: Checkout project - uses: actions/checkout@v1 + uses: actions/checkout@v2 - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'zulu' java-version: ${{ matrix.java }} - - name: Cache Maven repository - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: 'maven' - name: Build with Maven run: mvn -B test