-
-
Notifications
You must be signed in to change notification settings - Fork 11
132 lines (116 loc) · 4.25 KB
/
early-access.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Early Access
on:
push:
branches: [ master ]
jobs:
precheck:
if: github.repository == 'kordamp/pomchecker' && startsWith(github.event.head_commit.message, 'Releasing version') != true
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.vars.outputs.VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cancel previous run
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ vars.JAVA_VERSION }}
distribution: ${{ vars.JAVA_DISTRO }}
cache: maven
- name: Version
id: vars
shell: bash
run: |
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$(echo $version)" >> $GITHUB_OUTPUT
release:
needs: [ precheck ]
if: endsWith(${{ needs.precheck.outputs.VERSION }}, '-SNAPSHOT')
runs-on: ubuntu-latest
outputs:
JAR_SIZE: ${{ steps.bach.outputs.JAR_SIZE }}
JAR_CSUM: ${{ steps.bach.outputs.JAR_CSUM }}
DOC_SIZE: ${{ steps.bach.outputs.DOC_SIZE }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ vars.JAVA_VERSION }}
distribution: ${{ vars.JAVA_DISTRO }}
cache: maven
- name: Cache Gradle
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Cache Gradle wrapper
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
restore-keys: ${{ runner.os }}-gradlew-
- name: Build
run: ./mvnw -ntp -B --file pom.xml verify
- name: Release
uses: jreleaser/release-action@v2
with:
setup-java: false
env:
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
- name: Grab bach-info
id: bach
shell: bash
run: |
VERSION=${{ needs.precheck.outputs.VERSION }}
JAR_SIZE=$(ls -l pomchecker-toolprovider/target/pomchecker-toolprovider-${VERSION}.jar | awk '{print $5}')
JAR_CSUM=$(shasum -a 256 pomchecker-toolprovider/target/pomchecker-toolprovider-${VERSION}.jar | awk '{print $1}')
DOC_SIZE=$(ls -l README.adoc | awk '{print $5}')
echo "JAR_SIZE=$(echo $JAR_SIZE)" >> $GITHUB_OUTPUT
echo "JAR_CSUM=$(echo $JAR_CSUM)" >> $GITHUB_OUTPUT
echo "DOC_SIZE=$(echo $DOC_SIZE)" >> $GITHUB_OUTPUT
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
update-bach-info:
name: Update bach-info
needs: [ precheck, release ]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: kordamp/bach-info
ref: 'main'
fetch-depth: 0
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- name: Download bach-info script
run: |
curl -sL https://raw.githubusercontent.com/kordamp/pomchecker/master/.github/scripts/update-bach-info.sh --output update-bach-info.sh
chmod +x update-bach-info.sh
- name: Commit
env:
TAG: "early-access"
VERSION: ${{ needs.precheck.outputs.VERSION }}
JAR_SIZE: ${{ needs.release.outputs.JAR_SIZE }}
JAR_CSUM: ${{ needs.release.outputs.JAR_CSUM }}
DOC_SIZE: ${{ needs.release.outputs.DOC_SIZE }}
run: sh update-bach-info.sh