Compare commits
13 Commits
b6f22f8586
...
v0.1.0
Author | SHA1 | Date | |
---|---|---|---|
ced7f9be8a | |||
a662dca9ef | |||
0fae253761 | |||
7a6b8fb5f7 | |||
3748270003 | |||
27d21b0367 | |||
330a620b6f | |||
2afdc884bf | |||
bbc9489692 | |||
3b76f31071 | |||
fc12361a1d | |||
11297c9a56 | |||
417d3cb582 |
@@ -2,61 +2,81 @@ name: build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
tags:
|
||||||
- "main"
|
- "v*"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
OUT_DIR: ./output
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Create Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Create Release
|
||||||
|
uses: actions/create-release@latest
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ gitea.ref }}
|
||||||
|
release_name: "${{ gitea.event.repository.name }}-${{ gitea.ref }}"
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
publish:
|
publish:
|
||||||
name: publish
|
name: publish
|
||||||
# needs:
|
needs:
|
||||||
# - release
|
- release
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- target: windows-2022
|
- suffix: windows-x86_64
|
||||||
suffix: windows-x86_64
|
|
||||||
platform: windows-2022
|
platform: windows-2022
|
||||||
archive: zip
|
archive: zip
|
||||||
name: x86_64-pc-windows-msvc
|
name: x86_64-pc-windows-msvc
|
||||||
- target: x86_64-unknown-linux-gnu
|
- suffix: linux-x86_64
|
||||||
suffix: linux-x86_64
|
|
||||||
platform: ubuntu-latest
|
platform: ubuntu-latest
|
||||||
archive: tar.gz
|
archive: tar.gz
|
||||||
name: x86_64-unknown-linux-gnu
|
name: x86_64-unknown-linux-gnu
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
- name: Dump git[hub|ea] context
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Install alsa and udev
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libasound2-dev libudev-dev
|
||||||
|
- name: Setup Rust toolchain and cach
|
||||||
|
if: matrix.platform != 'windows-2022'
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
- name: Ensure rust is up to date
|
||||||
|
if: matrix.platform == 'windows-2022'
|
||||||
run: |
|
run: |
|
||||||
echo "$env:GITHUB_CONTEXT"
|
rustup update
|
||||||
echo "$env:GITEA_CONTEXT"
|
rustup toolchain install nightly
|
||||||
echo "$GITHUB_CONTEXT"
|
- name: Create output directory for windows
|
||||||
echo "$GITEA_CONTEXT"
|
if: matrix.platform == 'windows-2022'
|
||||||
env:
|
run: mkdir -f output
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
- name: Create output directory for linux
|
||||||
GITEA_CONTEXT: ${{ toJson(gitea) }}
|
if: matrix.platform != 'windows-2022'
|
||||||
|
run: mkdir output
|
||||||
# - name: Ensure rust is up to date
|
- name: Build release
|
||||||
# run: |
|
run: cargo +nightly -Z unstable-options b -r --artifact-dir ./output
|
||||||
# rustup update
|
- name: Collect windows artifacts
|
||||||
# rustup toolchain install nightly
|
if: matrix.platform == 'windows-2022'
|
||||||
# - uses: actions/checkout@v4
|
run: |
|
||||||
# - name: Create output directory
|
cp -r -fo assets $env:GITHUB_WORKSPACE/output/
|
||||||
# run: mkdir -f output
|
Compress-Archive -Force -Path $env:GITHUB_WORKSPACE/output/* -DestinationPath $env:GITHUB_WORKSPACE/${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }}
|
||||||
# - name: Build release
|
- name: Collect linux/macos artifacts
|
||||||
# run: cargo +nightly -Z unstable-options b -r --artifact-dir ./output
|
if: matrix.platform != 'windows-2022'
|
||||||
# - name: Collect windows artifacts
|
run: |
|
||||||
# if: matrix.platform != 'windows-2022'
|
cp -rf assets ${GITHUB_WORKSPACE}/output/
|
||||||
# shell: powershell
|
tar -czvf ${GITHUB_WORKSPACE}/${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }} -C ${GITHUB_WORKSPACE}/output/ .
|
||||||
# run: |
|
- name: Upload artifacts
|
||||||
# cp -r -fo assets $env:GITHUB_WORKSPACE/$env:OUT_DIR/
|
uses: akkuman/gitea-release-action@v1
|
||||||
# Compress-Archive -Path $env:GITHUB_WORKSPACE/$env:OUT_DIR/* -DestinationPath $env:GITHUB_WORKSPACE/mosquitoswatter_${{ matrix.name }}.${{ matrix.archive }}
|
with:
|
||||||
# - name: Upload artifacts
|
allowUpdates: true
|
||||||
# uses: ncipollo/release-action@v1
|
files: "${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }}"
|
||||||
# with:
|
|
||||||
# allowUpdates: true
|
|
||||||
# artifacts: "mosquitoswatter_${{ matrix.name }}.${{ matrix.archive }}"
|
|
||||||
|
Reference in New Issue
Block a user