Manual Release #37
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: Manual Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create tag by maven-release plugin | |
uses: qcastel/[email protected] | |
with: | |
release-branch-name: "master" | |
git-release-bot-name: "auto" | |
git-release-bot-email: "[email protected]" | |
skip-perform: true | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get the last tag name to set as version | |
id: get_version | |
run: echo ::set-output name=VERSION::$(git describe --tags $(git rev-list --tags --max-count=1)) | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ steps.get_version.outputs.VERSION }} | |
release_name: Release ${{ steps.get_version.outputs.VERSION }} | |
- name: Get the app version from the last tag name | |
id: get_app_version | |
run: echo ::set-output name=VERSION::$(git describe --tags $(git rev-list --tags --max-count=1) | cut -d'v' -f 2) | |
- name: Upload Release Asset | |
id: upload_release_asset | |
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: ./target/lo2iot-${{ steps.get_app_version.outputs.VERSION }}.zip | |
asset_name: lo2iot-${{ steps.get_app_version.outputs.VERSION }}.zip | |
asset_content_type: application/zip |