Skip to content

Feat: Check file checksums if provided #49

Feat: Check file checksums if provided

Feat: Check file checksums if provided #49

name: Publish release
on:
push:
branches:
- master
- develop
paths-ignore:
- '**.md'
- 'versions.yml'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
cache: gradle
- name: Install FUSE (ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get install libfuse2 fuse binutils
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run custom gradle package
run: gradle packageForRelease packageReleaseUberJarForCurrentOS
- name: Upload build
uses: actions/upload-artifact@v2
with:
name: build-${{ matrix.os }}
path: 'releases/*'
- name: Get version from gradle
shell: bash
if: ${{ matrix.os == 'ubuntu-latest' }}
id: extract_version
run: |
version=`gradle properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}'`
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create release version artifact
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
echo "${{ steps.extract_version.outputs.version }}" > version.txt
- name: Upload release version artifact
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v2
with:
name: version
path: version.txt
- name: Stop gradle daemon for Windows cache
if: ${{ matrix.os == 'windows-latest' }}
run: gradle --stop
publish-release:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Read versions file
shell: bash
id: extract_version
run: |
version=`cat artifacts/version/version.txt`
echo "version=$version" >> $GITHUB_OUTPUT
- name: Move all release artifacts into one folder
shell: bash
run: |
mkdir releases
mv artifacts/build*/* releases
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: "${{ github.ref == 'refs/heads/develop' }}"
automatic_release_tag: v${{ steps.extract_version.outputs.version }}
files: |
releases/*