split publish and release actions

This commit is contained in:
alice pellerin
2026-05-01 16:07:10 -05:00
parent 7740461805
commit 22542b6d29
2 changed files with 54 additions and 42 deletions
+9 -42
View File
@@ -1,53 +1,20 @@
name: publish release name: publish
on: on:
workflow_dispatch: workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: write
jobs: jobs:
publish: publish:
runs-on: ${{ matrix.info.runs-on }} runs-on: ubuntu-latest
# permissions: permissions:
# id-token: write # Required for OIDC token exchange id-token: write # Required for OIDC token exchange
strategy:
matrix:
info:
- os: "macOS"
runs-on: "macos-latest"
executable-extension: ""
- os: "linux-x86"
runs-on: "ubuntu-latest"
executable-extension: ""
- os: "linux-arm"
runs-on: "ubuntu-24.04-arm"
executable-extension: ""
- os: "Windows"
runs-on: "windows-latest"
executable-extension: ".exe"
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- name: check version - name: check version
# cut off the v part of the tag to only search for the number # cut off the v part of the tag to only search for the number
run: grep -q "$(echo "${{ github.ref_name }}" | cut -c2-)" Cargo.toml run: grep -q "$(echo "${{ github.ref_name }}" | cut -c2-)" Cargo.toml
- run: cargo test --release - uses: rust-lang/crates-io-auth-action@v1
- run: cargo build --release --locked id: auth
- name: package - run: cargo publish
# TODO: include completions/man page env:
run: tar -azcf "hexapoda-${{ matrix.info.os }}-${{ github.ref_name }}.zip" -C "target/release/" "hexapoda${{ matrix.info.executable-extension }}" CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- name: release
uses: softprops/action-gh-release@v2
with:
draft: true
name: "${{ github.ref_name }}"
files: hexapoda-${{ matrix.info.os }}-${{ github.ref_name }}.zip
# TODO: should cargo releases be manual ? just in case it fails on another platform?
# - uses: rust-lang/crates-io-auth-action@v1
# id: auth
# - run: cargo publish
# env:
# CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
+45
View File
@@ -0,0 +1,45 @@
name: release
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ${{ matrix.info.runs-on }}
strategy:
matrix:
info:
- os: "macOS"
runs-on: "macos-latest"
executable-extension: ""
- os: "linux-x86"
runs-on: "ubuntu-latest"
executable-extension: ""
- os: "linux-arm"
runs-on: "ubuntu-24.04-arm"
executable-extension: ""
- os: "Windows"
runs-on: "windows-latest"
executable-extension: ".exe"
steps:
- uses: actions/checkout@v6
- name: check version
# cut off the v part of the tag to only search for the number
run: grep -q "$(echo "${{ github.ref_name }}" | cut -c2-)" Cargo.toml
- run: cargo test --release
- run: cargo build --release --locked
- name: package
# TODO: include completions/man page
run: tar -azcf "hexapoda-${{ matrix.info.os }}-${{ github.ref_name }}.zip" -C "target/release/" "hexapoda${{ matrix.info.executable-extension }}"
- name: release
uses: softprops/action-gh-release@v2
with:
draft: true
name: "${{ github.ref_name }}"
files: hexapoda-${{ matrix.info.os }}-${{ github.ref_name }}.zip