-
Notifications
You must be signed in to change notification settings - Fork 1
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 #3 from PabloDons/master
workflow to automatically tag commits with version
- Loading branch information
Showing
2 changed files
with
21 additions
and
19 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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ $default-branch ] | ||
tags: | ||
- 'v*' | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
@@ -24,20 +23,27 @@ jobs: | |
- name: Build and test | ||
run: ./gradlew build | ||
|
||
- name: Tag name and copy jar | ||
id: names | ||
run: | | ||
echo ::set-output name=tag::${GITHUB_REF#refs/tags/} | ||
cp build/libs/RedstoneTools*.jar asset.jar | ||
- name: Get version | ||
id: version | ||
run: echo ::set-output name=version::v$(./gradlew -q getVersion).${{ github.run_number }} | ||
|
||
- name: Push new tag | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CUSTOM_TAG: ${{ steps.version.outputs.version }} | ||
|
||
- name: Copy jar | ||
run: cp build/libs/RedstoneTools*.jar asset.jar | ||
|
||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
name: ${{ steps.names.outputs.tag }} | ||
tag_name: ${{ steps.version.outputs.version }} | ||
release_name: ${{ steps.version.outputs.version }} | ||
draft: false | ||
prerelease: false | ||
|
||
|
@@ -48,5 +54,5 @@ jobs: | |
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: asset.jar | ||
asset_name: RedstoneTools-${{ steps.names.outputs.tag }}.jar | ||
asset_name: RedstoneTools-${{ steps.version.outputs.version }}.jar | ||
asset_content_type: application/java-archive |
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