Release #1
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: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "Branch to release from" | |
required: true | |
default: "master" | |
latest: | |
description: "Whether to create a release or not" | |
required: true | |
default: "false" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
artifact_name: task-tracker-cli-linux | |
extension: "" | |
- os: macos-latest | |
artifact_name: task-tracker-cli-macos | |
extension: "" | |
- os: windows-latest | |
artifact_name: task-tracker-cli-windows | |
extension: ".exe" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.branch }} | |
- name: Build | |
run: cargo build --release --verbose | |
- name: Archive Binary | |
if: startsWith(matrix.os, 'windows') == false | |
run: | | |
mkdir -p artifacts | |
cp target/release/task-tracker-cli${{ matrix.extension }} artifacts/ | |
- name: Archive Binary (Windows) | |
if: startsWith(matrix.os, 'windows') | |
run: | | |
mkdir artifacts | |
copy target\release\task-tracker-cli${{ matrix.extension }} artifacts\ | |
- name: Upload Release Assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: artifacts/task-tracker-cli${{ matrix.extension }} | |
create-release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./artifacts/* | |
make_latest: ${{ inputs.latest }} |