Automated build update #4
Workflow file for this run
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
name: Build and Release Package | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Prepare the release package | |
- name: Prepare the release package | |
id: prepare_release | |
run: | | |
VERSION=$(git describe --tags --always) | |
PACKAGE_NAME="${VERSION}" | |
mkdir -p $PACKAGE_NAME | |
cp -r bundle $PACKAGE_NAME/ | |
cp action.yml $PACKAGE_NAME/ | |
zip -r ${PACKAGE_NAME}.zip $PACKAGE_NAME/ | |
mkdir -p release | |
mv ${PACKAGE_NAME}.zip release/ | |
echo "PACKAGE_PATH=release/${PACKAGE_NAME}.zip" >> $GITHUB_ENV | |
ls -al release | |
shell: bash | |
# Create Release | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
# Upload release package to GitHub release | |
- name: Upload Release Assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.PACKAGE_PATH }} | |
asset_name: ${{ env.PACKAGE_PATH }} | |
asset_content_type: application/zip |