publish
This commit is contained in:
@@ -2,27 +2,24 @@ 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:
|
release:
|
||||||
name: Create Release
|
name: Create Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: actions/create-release@latest
|
uses: actions/create-release@latest
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ gitea.ref }}
|
tag_name: "${{ gitea.event.repository.name }} ${{ gitea.ref }}"
|
||||||
release_name: ${{ gitea.ref }}
|
release_name: "${{ gitea.event.repository.name }} ${{ gitea.ref }}"
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
publish:
|
publish:
|
||||||
@@ -43,7 +40,13 @@ jobs:
|
|||||||
name: x86_64-unknown-linux-gnu
|
name: x86_64-unknown-linux-gnu
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Setup Rust toolchain and cache
|
||||||
|
if: matrix.platform != 'windows-2022'
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
- name: Ensure rust is up to date
|
- name: Ensure rust is up to date
|
||||||
|
if: matrix.platform == 'windows-2022'
|
||||||
run: |
|
run: |
|
||||||
rustup update
|
rustup update
|
||||||
rustup toolchain install nightly
|
rustup toolchain install nightly
|
||||||
@@ -53,11 +56,15 @@ jobs:
|
|||||||
- name: Build release
|
- name: Build release
|
||||||
run: cargo +nightly -Z unstable-options b -r --artifact-dir ./output
|
run: cargo +nightly -Z unstable-options b -r --artifact-dir ./output
|
||||||
- name: Collect windows artifacts
|
- name: Collect windows artifacts
|
||||||
if: matrix.platform != 'windows-2022'
|
if: matrix.platform == 'windows-2022'
|
||||||
shell: powershell
|
|
||||||
run: |
|
run: |
|
||||||
cp -r -fo assets $env:GITEA_WORKSPACE/$env:OUT_DIR/
|
cp -r -fo assets $env:GITEA_WORKSPACE/output/
|
||||||
Compress-Archive -Path $env:GITEA_WORKSPACE/$env:OUT_DIR/* -DestinationPath $env:GITEA_WORKSPACE/${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }}
|
Compress-Archive -Path $env:GITEA_WORKSPACE/output/* -DestinationPath $env:GITEA_WORKSPACE/${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }}
|
||||||
|
- name: Collect linux/macos artifacts
|
||||||
|
if: matrix.platform != 'windows-latest'
|
||||||
|
run: |
|
||||||
|
cp -rf assets ${GITEA_WORKSPACE}/output/
|
||||||
|
tar -czvf ${GITHUB_WORKSPACE}/${{ gitea.event.repository.name }}_${{ matrix.name }}.${{ matrix.archive }} -C ${GITHUB_WORKSPACE}/output/ .
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
|
Reference in New Issue
Block a user