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-05-06 09:35:18 +01:00
|
|
|
env:
|
|
|
|
CARGO_TARGET_DIR: output
|
|
|
|
|
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
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Get version from manifest
|
2023-05-06 09:35:18 +01:00
|
|
|
uses: SebRollen/toml-action@9062fbef52816d61278d24ce53c8070440e1e8dd
|
2023-01-19 01:47:14 +00:00
|
|
|
id: get_version
|
|
|
|
with:
|
|
|
|
file: Cargo.toml
|
2023-02-06 00:24:53 +00:00
|
|
|
field: workspace.package.version
|
2023-01-19 01:47:14 +00:00
|
|
|
|
2023-05-06 10:48:33 +01:00
|
|
|
build:
|
|
|
|
needs: ["init"]
|
2023-01-19 01:47:14 +00:00
|
|
|
strategy:
|
|
|
|
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 09:35:18 +01:00
|
|
|
cargo-features: reqwest/rustls-tls
|
2023-02-15 22:03:31 +00:00
|
|
|
|
2023-05-06 08:01:46 +01:00
|
|
|
- name: Windows aarch64
|
|
|
|
runner-os: windows-latest
|
2023-05-06 10:48:33 +01:00
|
|
|
artifact-name: lune-${{ needs.init.outputs.version }}-windows-aarch64
|
2023-05-06 08:01:46 +01:00
|
|
|
cargo-target: aarch64-pc-windows-msvc
|
2023-05-06 09:35:18 +01:00
|
|
|
cargo-features: reqwest/default-tls
|
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-05-06 09:35:18 +01:00
|
|
|
cargo-features: reqwest/rustls-tls
|
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-05-06 09:35:18 +01:00
|
|
|
cargo-features: reqwest/rustls-tls
|
2023-05-06 08:01:46 +01:00
|
|
|
|
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 09:35:18 +01:00
|
|
|
cargo-features: reqwest/rustls-tls
|
2023-01-19 01:47:14 +00:00
|
|
|
|
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-05-06 09:35:18 +01:00
|
|
|
cargo-features: reqwest/rustls-tls
|
2023-05-06 08:01:46 +01:00
|
|
|
|
2023-01-19 01:47:14 +00:00
|
|
|
name: Build - ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.runner-os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- 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-05-06 09:35:18 +01:00
|
|
|
- name: Install 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-05-06 09:47:57 +01:00
|
|
|
shell: bash
|
2023-05-06 09:35:18 +01:00
|
|
|
run: |
|
|
|
|
cargo build \
|
|
|
|
--locked --release --all-features \
|
|
|
|
--target ${{ matrix.cargo-target }} \
|
|
|
|
--features ${{ matrix.cargo-features }}
|
2023-01-19 01:47:14 +00:00
|
|
|
|
|
|
|
- name: Create binary archive
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir -p staging
|
|
|
|
if [ "${{ matrix.runner-os }}" = "windows-latest" ]; then
|
2023-02-06 00:13:58 +00:00
|
|
|
cp "output/${{ matrix.cargo-target }}/release/lune.exe" staging/
|
2023-01-19 01:47:14 +00:00
|
|
|
cd staging
|
|
|
|
7z a ../release.zip *
|
|
|
|
else
|
2023-02-06 00:13:58 +00:00
|
|
|
cp "output/${{ matrix.cargo-target }}/release/lune" staging/
|
2023-01-19 01:47:14 +00:00
|
|
|
cd staging
|
2023-05-06 08:01:46 +01:00
|
|
|
chmod +x lune
|
2023-01-19 01:47:14 +00:00
|
|
|
zip ../release.zip *
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Upload binary artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact-name }}
|
|
|
|
path: release.zip
|
|
|
|
|
2023-05-06 10:48:33 +01:00
|
|
|
release:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: ["init", "build"]
|
|
|
|
steps:
|
2023-05-06 11:22:04 +01:00
|
|
|
- name: Download binaries
|
2023-05-06 10:48:33 +01:00
|
|
|
uses: actions/download-artifact@v3
|
2023-05-06 11:05:43 +01:00
|
|
|
with:
|
2023-05-06 11:22:04 +01:00
|
|
|
path: ./binaries
|
|
|
|
|
|
|
|
- name: List binaries
|
|
|
|
shell: bash
|
2023-05-06 11:44:49 +01:00
|
|
|
run: |
|
|
|
|
cd ./binaries
|
|
|
|
ls -lhrt
|
|
|
|
for DIR in */ ; do
|
|
|
|
cd "$DIR"
|
|
|
|
for FILE in * ; do
|
|
|
|
if [ ! -d "$FILE" ]; then
|
|
|
|
echo "$DIR$FILE"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cd ..
|
|
|
|
done
|
|
|
|
cd ..
|
2023-05-06 10:48:33 +01:00
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
uses: softprops/action-gh-release@v1
|
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
|
|
|
|
files: ./binaries/lune-**
|
2023-05-06 10:48:33 +01:00
|
|
|
draft: true
|