Skip to content

Gradle Package

Gradle Package #8

Workflow file for this run

# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: /~https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
name: Gradle Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download siardcmd.zip
uses: robinraju/release-downloader@v1.10
with:
repository: 'sfa-siard/SiardCmd'
# NB. SiardCmd has since started prefixing the tags with 'v'
tag: '2.2.1'
fileName: 'siardcmd.zip'
out-file-path: 'download'
extract: false
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
run: ./gradlew clean build -x download_siardcmd.zip
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload dbspec.zip as release asset
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv build/distributions/dbspec-*.zip dbspec.zip
gh release upload ${{ github.ref_name }} dbspec.zip