Skip to content

Release

Release #6

Workflow file for this run

name: Release
on:
workflow_dispatch:
env:
RUST_VERSION: 1.82.0
jobs:
setup:
runs-on: ubuntu-latest
outputs:
rust_version: ${{ env.RUST_VERSION }}
steps:
- run: echo "setting output variables"
build:
needs: setup
uses: ./.github/workflows/build.yml
with:
rust_version: ${{ needs.setup.outputs.rust_version }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: hub-recovery-*
path: artifacts
- name: Copy and rename executables
run: |
mkdir -p out
cp artifacts/hub-recovery-x86_64-unknown-linux-gnu/hub-recovery out/hub-recovery-linux-x86_64
cp artifacts/hub-recovery-aarch64-unknown-linux-gnu/hub-recovery out/hub-recovery-linux-aarch64
cp artifacts/hub-recovery-x86_64-pc-windows-msvc/hub-recovery.exe out/hub-recovery-windows-x86_64.exe
cp artifacts/hub-recovery-universal-apple-darwin/hub-recovery out/hub-recovery-macos
- name: Create release without tag
if: github.ref_type != 'tag'
env:
GH_TOKEN: ${{ secrets.repo-token }}
tag: ${{ github.sha }}
run: |
echo "Release without tag not supported"
exit 1
- name: Create release with tag
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ github.token }}
tag: ${{ github.ref_name }}
run: |
gh release create ${{ env.tag }} \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes \
--draft \
--verify-tag \
./out/*