From 5a01175a6da619794d6e383fd7116251452dbb9a Mon Sep 17 00:00:00 2001 From: Jakob Ecker Date: Fri, 15 Mar 2024 23:13:00 +0100 Subject: [PATCH] Add release action --- .github/workflows/check.yml | 2 +- .github/workflows/release.yml | 73 +++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a9e19e5..de549c1 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,7 +11,7 @@ permissions: security-events: write jobs: - build: + check: runs-on: "ubuntu-latest" env: GRADLE_OPTS: -Dorg.gradle.daemon=false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bef02de --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +name: Release + +on: + workflow_dispatch: + inputs: + bump: + description: Which part of the version to bump + required: true + default: patch + type: choice + options: + - patch + - minor + - major + +jobs: + package: + strategy: + matrix: + variant: + - { os: windows-latest, package: exe } + - { os: ubuntu-latest, package: deb } + runs-on: ${{ matrix.variant.os }} + steps: + - uses: actions/checkout@v4 + - name: Setup JDK 21 + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: temurin + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: wrapper + - name: Build & Package + run: ./gradlew packageDistributionForCurrentOS + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: dist-${{ matrix.variant.package }} + path: ${{ github.workspace }}/desktop-app/build/compose/binaries/main/${{ matrix.variant.package }}/*.${{ matrix.variant.package }} + + release: + needs: [package] + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + pattern: dist-* + merge-multiple: true + path: ${{ github.workspace }}/packages + - name: Display + run: ls -R ${{ github.workspace }} + - id: release + name: Create Release + uses: rymndhng/release-on-push-action@v0.9.3 + with: + name: HEMAtoma + bump_version_scheme: ${{ inputs.bump }} + use_github_release_notes: true + - name: Upload Release Artifacts + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.release.outputs.tag_name }} + files: | + ${{ github.workspace }}/packages/*.deb + ${{ github.workspace }}/packages/*.exe + +