Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-build releases (#282) #658

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Releases

on:
release:
types: [published]
HEdingfield marked this conversation as resolved.
Show resolved Hide resolved

jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: "Create filename"
id: fn
shell: bash
run: echo "FILENAME=build/rctab_${{ github.ref_name }}_${{ runner.os }}.zip" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3

- name: "Set up JDK 17.0.2"
uses: actions/setup-java@v3
with:
java-version: '17.0.2'
distribution: 'temurin'
artoonie marked this conversation as resolved.
Show resolved Hide resolved

- name: "Validate Gradle wrapper"
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
HEdingfield marked this conversation as resolved.
Show resolved Hide resolved

- name: "Create zip with Gradle"
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
artoonie marked this conversation as resolved.
Show resolved Hide resolved
with:
arguments: jlinkZip

- name: "Rename zip file"
run: cp build/rcv.zip ${{ steps.fn.outputs.FILENAME }}

- name: "Generate SHA512 for Linux"
if: runner.os == 'Linux'
run: sha512sum ${{ steps.fn.outputs.FILENAME }} > ${{ steps.fn.outputs.FILENAME }}.sha512
- name: "Generate SHA512 for Windows"
if: runner.os == 'Windows'
shell: bash
run: certutil -hashfile ${{ steps.fn.outputs.FILENAME }} SHA512 >> ${{ steps.fn.outputs.FILENAME }}.sha512
- name: "Generate SHA512 for OSX"
if: runner.os == 'macOS'
run: openssl dgst -sha512 > ${{ steps.fn.outputs.FILENAME }}.sha512

- uses: actions/upload-artifact@v3
with:
name: Package
if-no-files-found: error
path: |
${{ github.workspace }}/${{ steps.fn.outputs.FILENAME }}
${{ github.workspace }}/${{ steps.fn.outputs.FILENAME }}.sha512
retention-days: 90

- name: "Upload binaries to release"
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name }} == 'release'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/${{ steps.fn.outputs.FILENAME }}*
tag: ${{ github.ref_name }}
overwrite: true
file_glob: true