Repository navigation
62 lines (51 loc) · 1.48 KB
/
Copy pathrelease-assets.yml
File metadata and controls
62 lines (51 loc) · 1.48 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
name: Attach build artifacts to release
on:
push:
tags:
- "v*.*.*"
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [17, 21, 25]
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v6.3.0
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build with Maven
run: ./mvnw -B package
- name: Rename JAR
run: cp target/JavaCrypt.jar JavaCrypt-jdk${{ matrix.java }}.jar
- name: Upload build artifact
uses: actions/upload-artifact@v7
with:
name: JavaCrypt-jdk${{ matrix.java }}
path: JavaCrypt-jdk${{ matrix.java }}.jar
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all JARs
uses: actions/download-artifact@v8
with:
path: jars
merge-multiple: true
- name: Attach JARs to release
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
gh release view "$tag" --repo "${{ github.repository }}" >/dev/null 2>&1 \
|| gh release create "$tag" --repo "${{ github.repository }}" --generate-notes
gh release upload "$tag" jars/*.jar --repo "${{ github.repository }}" --clobber