mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
140 lines
4.3 KiB
YAML
140 lines
4.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
create-release:
|
|
name: Create release
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
manifest_version: ${{ steps.get_version.outputs.value }}
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Get version from manifest
|
|
uses: SebRollen/toml-action@0ad94c4a52c402aaa76e14e8a43551163b6cedf9
|
|
id: get_version
|
|
with:
|
|
file: Cargo.toml
|
|
field: package.version
|
|
|
|
- name: Create release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: v${{ steps.get_version.outputs.value }}
|
|
release_name: ${{ steps.get_version.outputs.value }}
|
|
draft: true
|
|
|
|
upload-assets:
|
|
needs: ["create-release"]
|
|
name: Upload assets
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Upload Selene types to release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
asset_path: lune.yml
|
|
asset_name: lune.yml
|
|
asset_content_type: application/x-yaml
|
|
|
|
- name: Upload Luau types to release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
asset_path: luneTypes.d.luau
|
|
asset_name: luneTypes.d.luau
|
|
asset_content_type: application/x-luau
|
|
|
|
- name: Upload documentation file to release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
asset_path: luneDocs.json
|
|
asset_name: luneDocs.json
|
|
asset_content_type: application/json
|
|
|
|
release:
|
|
needs: ["create-release"]
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: Windows x86_64
|
|
runner-os: windows-latest
|
|
artifact-name: lune-${{ needs.create-release.outputs.manifest_version }}-windows-x86_64
|
|
cargo-target: x86_64-pc-windows-msvc
|
|
- name: Linux x86_64
|
|
runner-os: ubuntu-latest
|
|
artifact-name: lune-${{ needs.create-release.outputs.manifest_version }}-linux-x86_64
|
|
cargo-target: x86_64-unknown-linux-gnu
|
|
- name: macOS x86_64
|
|
runner-os: macos-latest
|
|
artifact-name: lune-${{ needs.create-release.outputs.manifest_version }}-macos-x86_64
|
|
cargo-target: x86_64-apple-darwin
|
|
|
|
name: Build - ${{ matrix.name }}
|
|
runs-on: ${{ matrix.runner-os }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: ${{ matrix.cargo-target }}
|
|
override: true
|
|
profile: minimal
|
|
|
|
- name: Build binary
|
|
run: cargo build --package lune-cli --locked --release --all-features --target ${{ matrix.cargo-target }}
|
|
env:
|
|
CARGO_TARGET_DIR: output
|
|
|
|
- name: Create binary archive
|
|
shell: bash
|
|
run: |
|
|
mkdir -p staging
|
|
if [ "${{ matrix.runner-os }}" = "windows-latest" ]; then
|
|
cp "output/${{ matrix.cargo-target }}/release/lune.exe" staging/
|
|
cd staging
|
|
7z a ../release.zip *
|
|
else
|
|
cp "output/${{ matrix.cargo-target }}/release/lune" staging/
|
|
cd staging
|
|
zip ../release.zip *
|
|
fi
|
|
|
|
- name: Upload binary artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.artifact-name }}
|
|
path: release.zip
|
|
|
|
- name: Upload binary to release
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
asset_path: release.zip
|
|
asset_name: ${{ matrix.artifact-name }}.zip
|
|
asset_content_type: application/zip
|