-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove/replace deprecated actions * update remaining actions to latest version
- Loading branch information
Showing
1 changed file
with
20 additions
and
56 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,6 @@ name: Build | |
on: | ||
[push] | ||
|
||
env: | ||
APP_NAME: reverseCharger | ||
|
||
jobs: | ||
build: | ||
name: Build and Test | ||
|
@@ -14,26 +11,14 @@ jobs: | |
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" #This check is case insensitive | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v2 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 21 | ||
cache: 'maven' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Use a numerical verison for jpackage | ||
shell: pwsh | ||
run: | | ||
$numVer = (mvn help:evaluate '-Dexpression=project.version' '-q' '-DforceStdout') -replace '(\d{1,3}\.\d{1,3}\.\d{1,3})(.*)' ,'$1' | ||
mvn versions:set --file pom.xml "-DnewVersion=${numVer}" | ||
- name: Extract version from tag and set it as project version | ||
if: startsWith(github.ref, 'refs/tags/') | ||
shell: bash | ||
|
@@ -42,9 +27,9 @@ jobs: | |
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
- name: Uploads the build artifact | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{env.APP_NAME}}-${{runner.os}}.zip | ||
name: ${{runner.os}}.zip | ||
path: target/reverseCharger-*.zip | ||
|
||
release: | ||
|
@@ -58,43 +43,22 @@ jobs: | |
- name: Get version from tag and set up environment | ||
run: echo "BUILD_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v2 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: | | ||
:construction: Work in Progress | ||
draft: true | ||
prerelease: false | ||
- name: Upload linux package to release draft | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.APP_NAME }}-Linux.zip/reverseCharger-${{ env.BUILD_VERSION }}-linux.zip | ||
asset_name: ${{ env.APP_NAME }}-${{ env.BUILD_VERSION }}-linux.zip | ||
asset_content_type: application/gzip | ||
- name: Upload windows artifact to release draft | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
merge-multiple: true | ||
- name: Draft a release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.APP_NAME }}-Windows.zip/reverseCharger-${{ env.BUILD_VERSION }}-win.zip | ||
asset_name: ${{ env.APP_NAME }}-${{ env.BUILD_VERSION }}-win.zip | ||
asset_content_type: application/zip | ||
- name: Upload mac artifact to release draft | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
discussion_category_name: releases | ||
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} | ||
draft: true | ||
generate_release_notes: true | ||
body: |- | ||
:construction: Work in Progress | ||
- name: Publish build artifacts on release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.APP_NAME }}-macOS.zip/reverseCharger-${{ env.BUILD_VERSION }}-mac.zip | ||
asset_name: ${{ env.APP_NAME }}-${{ env.BUILD_VERSION }}-mac.zip | ||
asset_content_type: application/zip | ||
fail_on_unmatched_files: true | ||
token: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} | ||
files: | | ||
reverseCharger-*.zip |