Skip to content

Commit 80c5c6a

Browse files
authored
Updating github action to add release support. (kwhat#365)
1 parent dd033a7 commit 80c5c6a

File tree

1 file changed

+45
-32
lines changed

1 file changed

+45
-32
lines changed

.github/workflows/package.yml renamed to .github/workflows/continuous-integration.yml

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
name: Nightly Build
1+
name: Continuous Integration
22
on:
33
push:
44
branches:
5-
- '**'
5+
- '2.2'
6+
7+
release:
8+
types: [ created ]
69

710
jobs:
8-
generate-headers:
11+
compile-java:
912
runs-on: ubuntu-latest
1013
steps:
1114
- name: Checkout
@@ -20,7 +23,7 @@ jobs:
2023
java-package: jdk
2124
architecture: x64
2225

23-
- name: Generate
26+
- name: Compile
2427
shell: bash
2528
run: |
2629
mvn -B --no-transfer-progress compile
@@ -34,8 +37,8 @@ jobs:
3437
if-no-files-found: error
3538

3639

37-
apple-arm64:
38-
needs: generate-headers
40+
compile-apple-arm64:
41+
needs: compile-java
3942
runs-on: macos-latest
4043

4144
steps:
@@ -92,8 +95,8 @@ jobs:
9295
${{github.workspace}}/src/main/resources
9396
if-no-files-found: error
9497

95-
apple-x86_64:
96-
needs: generate-headers
98+
compile-apple-x86_64:
99+
needs: compile-java
97100
runs-on: macos-latest
98101

99102
steps:
@@ -151,8 +154,8 @@ jobs:
151154
if-no-files-found: error
152155

153156

154-
linux-arm:
155-
needs: generate-headers
157+
compile-linux-arm:
158+
needs: compile-java
156159
runs-on: ubuntu-latest
157160

158161
steps:
@@ -241,8 +244,8 @@ jobs:
241244
${{github.workspace}}/src/main/resources
242245
if-no-files-found: error
243246

244-
linux-arm64:
245-
needs: generate-headers
247+
compile-linux-arm64:
248+
needs: compile-java
246249
runs-on: ubuntu-latest
247250

248251
steps:
@@ -331,8 +334,8 @@ jobs:
331334
${{github.workspace}}/src/main/resources
332335
if-no-files-found: error
333336

334-
linux-x86:
335-
needs: generate-headers
337+
compile-linux-x86:
338+
needs: compile-java
336339
runs-on: ubuntu-latest
337340

338341
steps:
@@ -417,8 +420,8 @@ jobs:
417420
${{github.workspace}}/src/main/resources
418421
if-no-files-found: error
419422

420-
linux-x86_64:
421-
needs: generate-headers
423+
compile-linux-x86_64:
424+
needs: compile-java
422425
runs-on: ubuntu-latest
423426

424427
steps:
@@ -492,8 +495,8 @@ jobs:
492495
if-no-files-found: error
493496

494497

495-
windows-arm:
496-
needs: generate-headers
498+
compile-windows-arm:
499+
needs: compile-java
497500
runs-on: windows-latest
498501

499502
steps:
@@ -557,8 +560,8 @@ jobs:
557560
${{github.workspace}}/src/main/resources
558561
if-no-files-found: error
559562

560-
windows-x86:
561-
needs: generate-headers
563+
compile-windows-x86:
564+
needs: compile-java
562565
runs-on: windows-latest
563566

564567
steps:
@@ -620,8 +623,8 @@ jobs:
620623
${{github.workspace}}/src/main/resources
621624
if-no-files-found: error
622625

623-
windows-x86_64:
624-
needs: generate-headers
626+
compile-windows-x86_64:
627+
needs: compile-java
625628
runs-on: windows-latest
626629

627630
steps:
@@ -685,15 +688,15 @@ jobs:
685688

686689
package:
687690
needs: [
688-
apple-arm64,
689-
apple-x86_64,
690-
linux-arm,
691-
linux-arm64,
692-
linux-x86,
693-
linux-x86_64,
694-
windows-arm,
695-
windows-x86,
696-
windows-x86_64
691+
compile-apple-arm64,
692+
compile-apple-x86_64,
693+
compile-linux-arm,
694+
compile-linux-arm64,
695+
compile-linux-x86,
696+
compile-linux-x86_64,
697+
compile-windows-arm,
698+
compile-windows-x86,
699+
compile-windows-x86_64
697700
]
698701
runs-on: ubuntu-latest
699702
steps:
@@ -718,14 +721,24 @@ jobs:
718721
server-username: MAVEN_USERNAME
719722
server-password: MAVEN_PASSWORD
720723

721-
- name: Package
724+
- name: Package Snapshot
725+
if: ${{ github.event_name == 'push' }}
722726
env:
723727
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
724728
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
725729
shell: bash
726730
run: |
727731
mvn -B --no-transfer-progress deploy
728732
733+
- name: Package Release
734+
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
735+
env:
736+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
737+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
738+
shell: bash
739+
run: |
740+
mvn -Drevision="${GITHUB_REF#refs/tags/}" -B --no-transfer-progress deploy
741+
729742
- name: Upload
730743
uses: actions/upload-artifact@v2
731744
with:

0 commit comments

Comments
 (0)