Skip to content

Commit 0e3f397

Browse files
committed
ci: add GitHub Actions
1 parent 1f98383 commit 0e3f397

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build a snapshot
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
cache: maven
23+
- name: Generate single-use GPG key
24+
run: |
25+
name="Andrvotr single-use key for $GITHUB_REF $GITHUB_SHA $(date +%s)"
26+
gpg --yes --batch --pinentry-mode loopback --passphrase "" --quick-generate-key "$name" default default never
27+
- name: Build with Maven
28+
run: |
29+
MAVEN_GPG_PUBLIC_KEY="$(gpg --export --armor)" mvn -B verify
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
path: andrvotr-dist/target/*SNAPSHOT.tar.gz*

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
id-token: write
6+
attestations: write
7+
8+
on:
9+
push:
10+
tags:
11+
- '**[0-9]+.[0-9]+.[0-9]+*'
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
17+
env:
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
20+
MAVEN_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '17'
28+
distribution: 'temurin'
29+
cache: maven
30+
- name: Build with Maven
31+
run: mvn -B -Dgpg.signer=bc verify
32+
- name: Attest
33+
uses: actions/attest-build-provenance@v1
34+
with:
35+
subject-path: andrvotr-dist/target/*.tar.gz*
36+
- name: Release
37+
run: |
38+
title="Andrvotr $GITHUB_REF_NAME (for IdP 5.x)"
39+
gh release create "$GITHUB_REF_NAME" --title "$title" --verify-tag andrvotr-dist/target/*.tar.gz*

0 commit comments

Comments
 (0)