Release #1
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: | |
push: | |
tags: | |
- 'v*' | |
env: | |
ECOS_VERSION: v2.0.10 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
- name: Cache ECOS shared library | |
id: cache-ecos | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-ecos | |
with: | |
path: ./libecos.so | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.ECOS_VERSION }} | |
- if: ${{ steps.cache-ecos.outputs.cache-hit != 'true' }} | |
name: Download ECOS shared library | |
run: curl -L -O https://github.com/atraplet/ecos/releases/download/$ECOS_VERSION/libecos.so | |
- name: Build with Maven | |
env: | |
LD_LIBRARY_PATH: ./ | |
run: mvn -B clean package --file pom.xml | |
release: | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Publish to Maven Central | |
run: mvn -B clean deploy -P release --file pom.xml | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
- name: Create Release | |
uses: ncipollo/release-action@v1 |