-
-
Notifications
You must be signed in to change notification settings - Fork 50
147 lines (128 loc) · 4.73 KB
/
release.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
jobs:
precheck:
name: Precheck
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.vars.outputs.VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cancel previous run
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Version
id: vars
shell: bash
run: |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
build:
name: Build
needs: [precheck]
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ vars.JAVA_VERSION }}
distribution: ${{ vars.JAVA_DISTRO }}
cache: gradle
- name: Version
run: |
echo ${{ needs.precheck.outputs.VERSION }} > VERSION
- name: Build
run: ./gradlew -PreproducibleBuild=true build
- name: Assemble
run: ./gradlew -PreproducibleBuild=true :ikonli-browser:jlinkZip :ikonli-browser:jpackage
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ runner.os }}-${{ runner.arch }}
if-no-files-found: ignore
retention-days: 1
path: |
apps/ikonli-browser/build/distributions/ikonli-browser-*x86_64.zip
apps/ikonli-browser/build/packagers/ikonli-browser-*.rpm
apps/ikonli-browser/build/packagers/ikonli-browser-*.dmg
apps/ikonli-browser/build/packagers/ikonli-browser-*.exe
apps/ikonli-browser/build/packagers/ikonli-browser-*.msi
apps/ikonli-browser/build/packagers/ikonli-browser-*.pkg
apps/ikonli-browser/build/packagers/ikonli-browser-*.deb
release:
name: Release
needs: [precheck, build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: jpackage-*
merge-multiple: true
path: artifacts
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ vars.JAVA_VERSION }}
distribution: ${{ vars.JAVA_DISTRO }}
cache: gradle
- name: Version
run: |
echo ${{ needs.precheck.outputs.VERSION }} > VERSION
git add VERSION
sed -i -e "s/^\:project-version\:\ .*/:project-version: ${{ needs.precheck.outputs.VERSION }}/g" README.adoc
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Action"
git commit -a -m "Releasing version ${{ needs.precheck.outputs.VERSION }}"
git push origin master
- name: Deploy
run: |
./gradlew -Pprofile=release -PreproducibleBuild=true publish -S
- name: Upload deploy artifacts
uses: actions/upload-artifact@v4
with:
retention-days: 7
name: deploy
path: |
build/repos/local/release/
- name: Release
uses: jreleaser/release-action@v2
with:
arguments: full-release -P artifactsDir=artifacts
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 }}
JRELEASER_TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
JRELEASER_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
JRELEASER_MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties