2023-01-19 01:47:14 +00:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2023-01-19 03:15:13 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2023-09-11 19:16:43 +01:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2023-01-19 01:47:14 +00:00
|
|
|
jobs:
|
2023-05-06 10:48:33 +01:00
|
|
|
init:
|
|
|
|
name: Init
|
2023-01-19 01:47:14 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
2023-05-06 10:48:33 +01:00
|
|
|
version: ${{ steps.get_version.outputs.value }}
|
2023-01-19 01:47:14 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-09-11 19:16:43 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-01-19 01:47:14 +00:00
|
|
|
|
|
|
|
- name: Get version from manifest
|
2024-05-12 12:30:32 +01:00
|
|
|
uses: SebRollen/toml-action@v1.2.0
|
2023-01-19 01:47:14 +00:00
|
|
|
id: get_version
|
|
|
|
with:
|
2024-05-12 13:10:50 +01:00
|
|
|
file: crates/lune/Cargo.toml
|
2023-07-22 16:18:58 +01:00
|
|
|
field: package.version
|
2023-01-19 01:47:14 +00:00
|
|
|
|
2024-06-23 13:40:33 +01:00
|
|
|
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 }}
|
2024-05-12 12:30:32 +01:00
|
|
|
|
|
|
|
build:
|
2024-06-23 13:40:33 +01:00
|
|
|
needs: ["init", "dry-run"]
|
2023-01-19 01:47:14 +00:00
|
|
|
strategy:
|
2023-09-25 21:43:32 +01:00
|
|
|
fail-fast: false
|
2023-01-19 01:47:14 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: Windows x86_64
|
|
|
|
runner-os: windows-latest
|
2023-05-06 10:48:33 +01:00
|
|
|
artifact-name: lune-${{ needs.init.outputs.version }}-windows-x86_64
|
2023-01-19 01:47:14 +00:00
|
|
|
cargo-target: x86_64-pc-windows-msvc
|
2023-05-06 08:01:46 +01:00
|
|
|
|
2023-01-19 01:47:14 +00:00
|
|
|
- name: Linux x86_64
|
|
|
|
runner-os: ubuntu-latest
|
2023-05-06 10:48:33 +01:00
|
|
|
artifact-name: lune-${{ needs.init.outputs.version }}-linux-x86_64
|
2023-01-19 01:47:14 +00:00
|
|
|
cargo-target: x86_64-unknown-linux-gnu
|
2023-02-15 22:03:31 +00:00
|
|
|
|
2023-05-06 08:01:46 +01:00
|
|
|
- name: Linux aarch64
|
|
|
|
runner-os: ubuntu-latest
|
2023-05-06 10:48:33 +01:00
|
|
|
artifact-name: lune-${{ needs.init.outputs.version }}-linux-aarch64
|
2023-05-06 08:01:46 +01:00
|
|
|
cargo-target: aarch64-unknown-linux-gnu
|
|
|
|
|
2023-01-19 01:47:14 +00:00
|
|
|
- name: macOS x86_64
|
|
|
|
runner-os: macos-latest
|
2023-05-06 10:48:33 +01:00
|
|
|
artifact-name: lune-${{ needs.init.outputs.version }}-macos-x86_64
|
2023-01-19 01:47:14 +00:00
|
|
|
cargo-target: x86_64-apple-darwin
|
|
|
|
|
2023-05-06 08:01:46 +01:00
|
|
|
- name: macOS aarch64
|
|
|
|
runner-os: macos-latest
|
2023-05-06 10:48:33 +01:00
|
|
|
artifact-name: lune-${{ needs.init.outputs.version }}-macos-aarch64
|
2023-05-06 08:01:46 +01:00
|
|
|
cargo-target: aarch64-apple-darwin
|
|
|
|
|
2023-01-19 01:47:14 +00:00
|
|
|
name: Build - ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.runner-os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-09-11 19:16:43 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-01-19 01:47:14 +00:00
|
|
|
|
|
|
|
- name: Install Rust
|
2023-02-23 20:05:25 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2023-01-19 01:47:14 +00:00
|
|
|
with:
|
2023-02-23 20:05:25 +00:00
|
|
|
targets: ${{ matrix.cargo-target }}
|
2023-01-19 01:47:14 +00:00
|
|
|
|
2023-09-25 21:43:32 +01:00
|
|
|
- name: Install Just
|
2024-05-12 12:30:32 +01:00
|
|
|
uses: extractions/setup-just@v2
|
2023-09-25 21:43:32 +01:00
|
|
|
|
2023-09-11 19:16:43 +01:00
|
|
|
- name: Install build tooling (aarch64-unknown-linux-gnu)
|
2023-05-06 08:53:42 +01:00
|
|
|
if: matrix.cargo-target == 'aarch64-unknown-linux-gnu'
|
2023-05-06 08:15:55 +01:00
|
|
|
run: |
|
|
|
|
sudo apt-get update -y
|
|
|
|
sudo apt-get install -y musl-tools clang llvm
|
2023-05-06 08:22:53 +01:00
|
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
2023-05-06 08:15:55 +01:00
|
|
|
|
2023-01-19 01:47:14 +00:00
|
|
|
- name: Build binary
|
2023-09-25 21:43:32 +01:00
|
|
|
run: just build --locked --release --target ${{ matrix.cargo-target }}
|
2023-01-19 01:47:14 +00:00
|
|
|
|
2023-09-25 21:43:32 +01:00
|
|
|
- name: Create release archive
|
|
|
|
run: just zip-release ${{ matrix.cargo-target }}
|
|
|
|
|
|
|
|
- name: Upload release artifact
|
2024-05-12 12:30:32 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-01-19 01:47:14 +00:00
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact-name }}
|
|
|
|
path: release.zip
|
|
|
|
|
2024-05-12 12:30:32 +01:00
|
|
|
release-github:
|
|
|
|
name: Release (GitHub)
|
2023-05-06 10:48:33 +01:00
|
|
|
runs-on: ubuntu-latest
|
2024-06-23 13:40:33 +01:00
|
|
|
needs: ["init", "dry-run", "build"]
|
2023-05-06 10:48:33 +01:00
|
|
|
steps:
|
2023-09-25 21:43:32 +01:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Install Just
|
2024-05-12 12:30:32 +01:00
|
|
|
uses: extractions/setup-just@v2
|
2023-09-25 21:43:32 +01:00
|
|
|
|
|
|
|
- name: Download releases
|
2024-05-12 12:30:32 +01:00
|
|
|
uses: actions/download-artifact@v4
|
2023-05-06 11:05:43 +01:00
|
|
|
with:
|
2023-09-25 21:43:32 +01:00
|
|
|
path: ./releases
|
2023-05-06 11:22:04 +01:00
|
|
|
|
2023-09-25 21:43:32 +01:00
|
|
|
- name: Unpack releases
|
|
|
|
run: just unpack-releases "./releases"
|
2023-05-06 10:48:33 +01:00
|
|
|
|
|
|
|
- name: Create release
|
2024-05-12 12:30:32 +01:00
|
|
|
uses: softprops/action-gh-release@v2
|
2023-01-19 01:47:14 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2023-05-06 10:48:33 +01:00
|
|
|
name: ${{ needs.init.outputs.version }}
|
|
|
|
tag_name: v${{ needs.init.outputs.version }}
|
2023-05-06 11:22:04 +01:00
|
|
|
fail_on_unmatched_files: true
|
2023-09-25 21:43:32 +01:00
|
|
|
files: ./releases/*.zip
|
2023-05-06 10:48:33 +01:00
|
|
|
draft: true
|
2024-05-12 12:30:32 +01:00
|
|
|
|
2024-06-23 13:40:33 +01:00
|
|
|
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 }}
|