-
Notifications
You must be signed in to change notification settings - Fork 5
63 lines (54 loc) · 2.14 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (54 loc) · 2.14 KB
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
name: Release
# Publishes a GitHub release with the fat jar attached.
#
# Triggered by pushing a version tag:
#
# git tag v1.0.1 && git push origin v1.0.1
#
# The asset is the tracked jars/aips2sqlite.jar, NOT a jar compiled here. That
# is deliberate: src/com/maxl/java/aips2sqlite/Crypto.java is gitignored (it
# names the path of the private AES key file used by the partner exports), so a
# fresh checkout does not compile — `./gradlew jar` fails with "Symbol nicht
# gefunden: Crypto" at the six call sites in FileOps/GlnCodes/ShoppingCart*.
# jars/aips2sqlite.jar is also the artifact of record: mediupdatexml.oddb.org
# runs it straight out of the checkout after `git pull`, so shipping the same
# bytes as the release asset is what you want anyway.
#
# So: rebuild and commit the jar as part of the release commit (see README,
# "Releases"), then tag. This job verifies the committed jar actually starts
# before it publishes.
#
# To build in CI instead, commit Crypto.java (it holds no key — only the IV and
# the path to secret.txt, which stays out of git) and swap the two steps below
# for `./gradlew --no-daemon jar`.
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# Java 21 is the floor (README "Requirements"); Temurin matches what the
# Debian host runs (OpenJDK 21).
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
# Guards against tagging a release whose jar was never rebuilt for it.
- name: Check the jar is present
run: test -s jars/aips2sqlite.jar
# Smoke test: loads the main class and every bundled dependency, then
# exits 0. --version fell through into the real pipeline and started
# downloading until 1.0.3, which is why this is --help; both exit now.
- name: Check the jar starts
run: java -jar jars/aips2sqlite.jar --help
- name: Publish the release
uses: softprops/action-gh-release@v3
with:
files: jars/aips2sqlite.jar
generate_release_notes: true