chore: release 0.0.7 #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
pull_request: | |
types: [ closed ] | |
paths: | |
- '.github/project.yml' | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
maven-release: | |
runs-on: ubuntu-latest | |
name: Release power-server | |
if: ${{github.event.pull_request.merged == true}} | |
steps: | |
- uses: radcortez/project-metadata-action@main | |
name: Retrieve project metadata | |
id: metadata | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
metadata-file-path: '.github/project.yml' | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'maven' | |
server-id: central | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Configure Git author | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Maven release ${{steps.metadata.outputs.current-version}} | |
run: | | |
mvn -B release:prepare -Prelease -Darguments="-DskipTests" -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} | |
mvn -B release:perform -Darguments="-DperformRelease -DskipTests" -DperformRelease -Prelease | |
env: | |
MAVEN_USERNAME: "${{ secrets.OSSRH_USERNAME }}" | |
MAVEN_PASSWORD: "${{ secrets.OSSRH_TOKEN }}" | |
MAVEN_GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" | |
- name: Push changes to ${{github.base_ref}} branch | |
run: | | |
git push | |
git push origin ${{steps.metadata.outputs.current-version}} | |
# Build native executable per runner | |
package: | |
needs: [ maven-release ] | |
name: 'Build with Graal on ${{ matrix.os }}' | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ ubuntu-latest, macOS-latest, macos-14 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: 'Check out repository' | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'maven' | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '17' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: 'true' | |
- name: 'Build project' | |
run: mvn install -DskipTests | |
- name: 'Build Native Image' | |
run: | | |
pushd server | |
mvn -ntp -B --file pom.xml -Pnative package -DskipTests | |
popd | |
- name: 'Create distribution' | |
run: | | |
pushd server | |
mvn -ntp -B --file pom.xml -Pdist package -DskipTests | |
popd | |
- name: 'Upload build artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: power-server-${{ runner.os }}-${{ runner.arch }} | |
path: server/target/distributions/*.tar.gz | |
# Collect all executables and release | |
release: | |
needs: [ maven-release, package ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Check out repository' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# checkout will clobber downloaded artifacts | |
# we have to download them again | |
- name: 'Download all build artifacts' | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
pattern: power-server-* | |
merge-multiple: true | |
- name: 'Set up Java' | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: maven | |
- name: 'Release with JReleaser' | |
env: | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mvn -ntp -B --file server/pom.xml -Prelease -DartifactsDir=artifacts jreleaser:full-release | |
- name: 'JReleaser output' | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jreleaser-logs | |
path: | | |
target/jreleaser/trace.log | |
target/jreleaser/output.properties |