build: Release artifacts #21
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - run: git fetch --tags --force origin #workaround https://github.com/actions/checkout/issues/882 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4.2.1 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build | |
| run: ./gradlew clean build | |
| - name: Project Version | |
| id: project_version | |
| run: | | |
| # Project Version | |
| output=$(./gradlew -q version) | |
| project_version=$(echo "$output" | grep 'Version:' | awk '{print $2}') | |
| echo "project_version=$project_version" >> "$GITHUB_OUTPUT" | |
| - name: Print Project Version | |
| run: | | |
| echo "Project Version: ${{ steps.project_version.outputs.project_version }}" | |
| - name: Assemble distribution (Release) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: ./gradlew assembleDist | |
| - name: Generate Checksum (Release) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| working-directory: ./converter/build/distributions | |
| run: | | |
| shasum -a 256 "converter-${{ steps.project_version.outputs.project_version }}.tar.gz" > "converter-${{ steps.project_version.outputs.project_version }}.tar.gz.sha256" | |
| shasum -a 256 "converter-${{ steps.project_version.outputs.project_version }}.zip" > "converter-${{ steps.project_version.outputs.project_version }}.zip.sha256" | |
| - name: Upload distribution artifacts (Release) | |
| uses: actions/upload-artifact@v4 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| name: distribution | |
| path: converter/build/distributions/ | |
| retention-days: 1 | |
| if-no-files-found: error | |
| release: | |
| runs-on: ubuntu-24.04 | |
| needs: [build] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| environment: release | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: "Download Artifacts" | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: distribution | |
| path: converter/build/distributions/ | |
| - name: Release | |
| id: release | |
| uses: softprops/action-gh-release@v2.2.1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| converter/build/distributions/converter-${{ github.ref_name }}.tar.gz | |
| converter/build/distributions/converter-${{ github.ref_name }}.tar.gz.sha256 | |
| converter/build/distributions/converter-${{ github.ref_name }}.zip | |
| converter/build/distributions/converter-${{ github.ref_name }}.zip.sha256 | |
| body: | | |
| ** V4 Keystore Converter Release ** | |
| draft: true | |
| preserve_order: true | |
| generate_release_notes: true |