Fix release workflow #16
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: Release | |
on: | |
push: | |
tags: ["v*"] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Specify a version tag (v#.#.#)" | |
required: true | |
permissions: | |
contents: write # needed to create releases | |
jobs: | |
create-release: | |
name: Create release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref_name }} | |
draft: true | |
prerelease: false | |
build: | |
needs: ["create-release"] | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install clang | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y clang | |
- name: Build | |
run: make amalgamate | |
- name: Create Release Archive | |
shell: bash | |
run: | | |
mkdir staging | |
cp amalgamate/caught.h amalgamate/caught.c staging/ | |
cd staging | |
zip ../release.zip * | |
- name: Upload .h to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
asset_path: amalgamate/caught.h | |
asset_name: caught.h | |
asset_content_type: application/octet-stream | |
- name: Upload .c to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
asset_path: amalgamate/caught.c | |
asset_name: caught.c | |
asset_content_type: application/octet-stream | |
- name: Upload .h as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: caught.h | |
path: amalgamate/caught.h | |
- name: Upload .c as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: caught.c | |
path: amalgamate/caught.c |