-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from hizumiaoba/develop
Switch to main-only branch strategy
- Loading branch information
Showing
18 changed files
with
1,043 additions
and
71 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
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 |
---|---|---|
|
@@ -4,11 +4,43 @@ name: Bump version | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
|
||
compile: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest ] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | ||
- name: Grant execution permission for wrapper file | ||
run: chmod +x ./gradlew ./gradlew.bat | ||
- name: Gradle build action | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
build | ||
--scan | ||
--refresh-dependencies | ||
--no-build-cache | ||
--rerun-tasks | ||
release: | ||
|
||
# This job needs the compile job so that any compile error prevents generating a redundant release | ||
needs: compile | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
@@ -21,16 +53,38 @@ jobs: | |
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
dry_run: true | ||
- name: Show release informations | ||
id: diff | ||
run: | | ||
LATEST_TAG=$(git describe --tags --abbrev=0) | ||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 $LATEST_TAG^) | ||
CHANGES=$(git log $PREVIOUS_TAG..$LATEST_TAG --pretty=format:"- %s (%an)" --no-merges) | ||
echo "LATEST_TAG=$LATEST_TAG" | ||
echo "PREVIOUS_TAG=$PREVIOUS_TAG" | ||
echo "CHANGES=$CHANGES" | ||
echo "::set-output name=changelog::$CHANGES" | ||
- name: Create a github release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.tag_version.outputs.new_tag }} | ||
release_name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
draft: false | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
このリリースでの変更点: | ||
${{ steps.diff.outputs.changelog }} | ||
draft: true | ||
|
||
bash-artifact-upload: | ||
# uses shadowJar task to provide the artifact | ||
needs: release | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
|
@@ -39,23 +93,19 @@ jobs: | |
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | ||
- name: Grant execution permission for wrapper file | ||
run: chmod +x ./gradlew ./gradlew.bat | ||
run: chmod +x ./gradlew | ||
- name: Gradle build action | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: | | ||
jpackageImage | ||
-i | ||
--scan | ||
- name: compress artifact | ||
run: zip -r release.zip build/jpackage/MinecraftTimeMachine | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
shadowJar | ||
--stacktrace | ||
- name: upload artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./release.zip | ||
asset_name: release.zip | ||
asset_content_type: application/zip | ||
upload_url: ${{ needs.release.outputs.create_release.outputs.upload_url }} | ||
asset_path: build/libs/mctimemachine-all.jar | ||
asset_name: MinecraftTimeMachine-${{ github.ref }}-executable.jar | ||
asset-content-type: application/java-archive |
Oops, something went wrong.