Skip to content

Commit

Permalink
update github action to publish correctly release files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus-Osuna-M committed Jan 31, 2025
1 parent c932ef0 commit 6844d77
Showing 1 changed file with 12 additions and 55 deletions.
67 changes: 12 additions & 55 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release

Expand All @@ -23,58 +22,16 @@ jobs:
run: ./gradlew build
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false

- name: Upload Command Plugin (zip)
id: upload-release-asset-command
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: ./command/build/libs/command-v${{ steps.get_version.outputs.VERSION }}.zip
asset_name: command-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip

- name: Upload File Plugin (zip)
id: upload-release-asset-file
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: ./file/build/libs/file-v${{ steps.get_version.outputs.VERSION }}.zip
asset_name: file-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip

- name: Upload local-script Plugin (zip)
id: upload-release-asset-loca-script
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(./gradlew currentVersion -q -Prelease.quiet)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
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: ./local-script/build/libs/local-script-v${{ steps.get_version.outputs.VERSION }}.zip
asset_name: local-script-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip

- name: Upload waitfor Plugin (zip)
id: upload-release-asset-waitfor
uses: actions/upload-release-asset@v1
files: |
./command/build/libs/command-v${{ env.VERSION }}.zip
./file/build/libs/file-v${{ env.VERSION }}.zip
./local-script/build/libs/local-script-v${{ env.VERSION }}.zip
./waitfor/build/libs/waitfor-v${{ env.VERSION }}.zip
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: ./waitfor/build/libs/waitfor-v${{ steps.get_version.outputs.VERSION }}.zip
asset_name: waitfor-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6844d77

Please sign in to comment.