Release #104
This file contains hidden or 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: | |
permissions: | |
contents: write | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
init: | |
name: Init | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get_version.outputs.value }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get version from manifest | |
id: get_version | |
run: | | |
PACKAGE_VERSION=$(./scripts/get-version.sh) | |
echo "value=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT | |
dry-run: | |
name: Dry-run | |
needs: ["init"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Publish (dry-run) | |
uses: katyo/publish-crates@v2 | |
with: | |
dry-run: true | |
check-repo: true | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
build: | |
needs: ["init", "dry-run"] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- name: Windows x86_64 | |
runner-os: windows-2022 | |
artifact-name: lune-${{ needs.init.outputs.version }}-windows-x86_64 | |
cargo-target: x86_64-pc-windows-msvc | |
- name: Windows aarch64 | |
runner-os: windows-11-arm | |
artifact-name: lune-${{ needs.init.outputs.version }}-windows-aarch64 | |
cargo-target: aarch64-pc-windows-msvc | |
- name: Linux x86_64 | |
runner-os: ubuntu-22.04 | |
artifact-name: lune-${{ needs.init.outputs.version }}-linux-x86_64 | |
cargo-target: x86_64-unknown-linux-gnu | |
- name: Linux aarch64 | |
runner-os: ubuntu-22.04-arm | |
artifact-name: lune-${{ needs.init.outputs.version }}-linux-aarch64 | |
cargo-target: aarch64-unknown-linux-gnu | |
- name: macOS x86_64 | |
runner-os: macos-15 | |
artifact-name: lune-${{ needs.init.outputs.version }}-macos-x86_64 | |
cargo-target: x86_64-apple-darwin | |
- name: macOS aarch64 | |
runner-os: macos-15 | |
artifact-name: lune-${{ needs.init.outputs.version }}-macos-aarch64 | |
cargo-target: aarch64-apple-darwin | |
name: Build - ${{ matrix.name }} | |
runs-on: ${{ matrix.runner-os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.cargo-target }} | |
- name: Build binary | |
run: | | |
cargo build \ | |
--locked --all-features \ | |
--release --target ${{ matrix.cargo-target }} | |
- name: Create release archive | |
run: ./scripts/zip-release.sh ${{ matrix.cargo-target }} | |
- name: Upload release artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: release.zip | |
release-github: | |
name: Release (GitHub) | |
runs-on: ubuntu-latest | |
needs: ["init", "dry-run", "build"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download releases | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./releases | |
- name: Unpack releases | |
run: ./scripts/unpack-releases.sh "./releases" | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ needs.init.outputs.version }} | |
tag_name: v${{ needs.init.outputs.version }} | |
fail_on_unmatched_files: true | |
files: ./releases/*.zip | |
draft: true | |
release-crates: | |
name: Release (crates.io) | |
runs-on: ubuntu-latest | |
needs: ["init", "dry-run", "build"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Publish crates | |
uses: katyo/publish-crates@v2 | |
with: | |
dry-run: false | |
check-repo: true | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} |