Release CI #3
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: Release CI | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
version: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: 'Release version' | |
# Input has to be provided for the workflow to run | |
required: true | |
# The data type of the input | |
type: string | |
description: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: 'Release description' | |
# Input has to be provided for the workflow to run | |
required: true | |
# The data type of the input | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build source code | |
run: | | |
make build | |
zip -r bin.zip bin | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ inputs.version }} | |
release_name: v${{ inputs.version }} | |
body: ${{ inputs.description }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_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: ./bin.zip | |
asset_name: bin.zip | |
asset_content_type: application/zip |