Publish Draft Release #9
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: Publish Draft Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version (e.g. 1.0.0)' | |
required: true | |
type: string | |
permissions: | |
contents: write | |
jobs: | |
build_test_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4 | |
- name: Mark Gradle as Executable | |
run: chmod +x gradlew | |
- name: Build with Gradle Wrapper | |
run: ./gradlew build | |
- name: Upload CLI Jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jar-builds | |
path: build/libs/*.jar | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-builds | |
path: build/libs/linux/ | |
build_windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4 | |
- name: Build with Gradle Wrapper | |
run: ./gradlew build -x test | |
- name: Sign files with Trusted Signing | |
uses: azure/trusted-signing-action@v0.4.0 | |
with: | |
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
endpoint: https://weu.codesigning.azure.net/ | |
trusted-signing-account-name: hivegames | |
certificate-profile-name: Chunker | |
files-folder: build/libs/windows/ | |
files-folder-filter: exe | |
file-digest: SHA256 | |
timestamp-rfc3161: http://timestamp.acs.microsoft.com | |
timestamp-digest: SHA256 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-builds | |
path: build/libs/windows/ | |
build_mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4 | |
- name: Mark Gradle as Executable | |
run: chmod +x gradlew | |
- name: Build with Gradle Wrapper | |
run: ./gradlew build -x test | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-builds | |
path: build/libs/mac/ | |
publish: | |
runs-on: ubuntu-latest | |
needs: [ build_test_linux, build_windows, build_mac ] | |
steps: | |
- name: Download JAR artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: jar-builds | |
path: artifacts | |
- name: Download Linux artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: linux-builds | |
path: artifacts | |
- name: Compress Linux CLI | |
run: | | |
cd artifacts && zip -r "chunker-cli-linux-amd64.zip" "chunker-cli" && cd .. | |
rm -rf "artifacts/chunker-cli" | |
- name: Rename AppImage files | |
run: | | |
for file in artifacts/*.AppImage; do | |
mv "$file" "${file%.AppImage}-amd64-linux.AppImage" | |
done | |
- name: Download Windows artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: windows-builds | |
path: artifacts | |
- name: Compress Windows CLI | |
run: | | |
cd artifacts && zip -r "chunker-cli-windows-x86.zip" "chunker-cli" && cd .. | |
rm -rf "artifacts/chunker-cli" | |
- name: Rename exe files | |
run: | | |
for file in artifacts/*.exe; do | |
base_name="${file#artifacts/Chunker }" | |
base_name="${base_name%.exe}" | |
mv "$file" "artifacts/Chunker-${base_name}-windows-x86.exe" | |
done | |
- name: Download Mac artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos-builds | |
path: artifacts | |
- name: Compress Mac CLI | |
run: | | |
cd artifacts && zip -r "chunker-cli-mac-arm64.app.zip" "chunker-cli.app" && cd .. | |
rm -rf "artifacts/chunker-cli.app" | |
- name: Remove blockmap files | |
run: | | |
rm -rf artifacts/*.blockmap | |
- name: Rename dmg files | |
run: | | |
for file in artifacts/*.dmg; do | |
mv "$file" "${file%.dmg}-mac.dmg" | |
done | |
- name: Create Draft Release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GH_REPO: ${{ github.repository }} | |
run: | | |
tag="${{ github.event.inputs.version }}" | |
gh release create --draft "$tag" --title "$tag" --notes "TODO" | |
- name: Upload Artifacts | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GH_REPO: ${{ github.repository }} | |
run: | | |
for file in artifacts/*; do | |
gh release upload ${{ github.event.inputs.version }} "$file" | |
done |