Skip to content

Commit ae5b98a

Browse files
authored
Add initial GitHub action workflows
1 parent a91d7ac commit ae5b98a

2 files changed

Lines changed: 109 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Build Release Artifacts
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Release tag (e.g., v0.5.0)"
8+
required: true
9+
type: string
10+
prerelease:
11+
description: "Mark GitHub release as prerelease"
12+
required: false
13+
default: "false"
14+
type: choice
15+
options:
16+
- "false"
17+
- "true"
18+
release_notes:
19+
description: "Optional markdown notes (e.g., '- Added ...')"
20+
required: false
21+
default: ""
22+
type: string
23+
24+
permissions:
25+
contents: write
26+
27+
jobs:
28+
build:
29+
if: github.event_name == 'workflow_dispatch' && github.repository == 'NetSPI/OCISigner'
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
with:
34+
fetch-depth: 1
35+
36+
- name: Set up JDK 25
37+
uses: actions/setup-java@v5
38+
with:
39+
distribution: temurin
40+
java-version: "25"
41+
cache: maven
42+
43+
- name: Build
44+
run: mvn -B -Dmaven.test.skip=true clean package
45+
46+
- name: Locate shaded jar
47+
id: artifact
48+
run: |
49+
jar=$(ls target/*-all.jar | head -n 1)
50+
echo "jar=$jar" >> "$GITHUB_OUTPUT"
51+
52+
- name: Upload artifact
53+
uses: actions/upload-artifact@v6
54+
with:
55+
name: OCISigner-jar
56+
path: ${{ steps.artifact.outputs.jar }}
57+
58+
release:
59+
if: github.event_name == 'workflow_dispatch' && github.repository == 'NetSPI/OCISigner'
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- uses: actions/download-artifact@v7
64+
with:
65+
path: dist
66+
67+
- name: Create GitHub release
68+
uses: softprops/action-gh-release@v2
69+
with:
70+
tag_name: ${{ inputs.tag }}
71+
name: ${{ inputs.tag }}
72+
prerelease: ${{ inputs.prerelease }}
73+
generate_release_notes: true
74+
append_body: true
75+
body: ${{ inputs.release_notes }}
76+
files: dist/**/*

.github/workflows/unit-tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
unit-tests:
14+
name: Unit Tests (jdk${{ matrix.java-version }}) [${{ github.ref_name }}]
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
java-version: ["25"]
20+
21+
steps:
22+
- uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 1
25+
26+
- uses: actions/setup-java@v5
27+
with:
28+
distribution: temurin
29+
java-version: ${{ matrix.java-version }}
30+
cache: maven
31+
32+
- name: Run unit tests
33+
run: mvn -B test

0 commit comments

Comments
 (0)