- Remove `codeql.yml` workflow for static security analysis. - Add `pages.yml` workflow for deploying docs to GitHub Pages. - Introduce `CODE_OF_CONDUCT.md` and `FUNDING.yml`. - Update `README.md` with links to GitHub Pages and additional project setup details. - Refine release workflow by splitting build and publish steps, and allowing publish errors for existing versions.
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
# On push of a version tag (e.g. v1.0.0): build, publish to GitHub Packages, create Release, upload JARs.
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RELEASE_VERSION: ${{ github.ref_name }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: 21
|
|
cache: gradle
|
|
|
|
- name: Strip v from version
|
|
run: echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
run: chmod +x gradlew && ./gradlew build --no-daemon
|
|
|
|
- name: Publish to GitHub Packages
|
|
run: ./gradlew publish --no-daemon
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
continue-on-error: true
|
|
# 409 = version already exists; use a new tag (e.g. v1.0.2) next time
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: build/libs/*.jar
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|