Various fixes and improvements #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Build 🌙🛠️ | |
on: | |
push: | |
branches: main | |
paths: | |
- .github/workflows/nightly.yml | |
- src/** | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: pwsh | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
lfs: true | |
persist-credentials: false | |
- name: Setup Rust and Zig | |
run: | | |
rustup target add aarch64-pc-windows-msvc | |
rustup target add x86_64-unknown-linux-gnu | |
rustup target add aarch64-unknown-linux-gnu | |
choco install zig | |
iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content | |
cargo binstall cargo-zigbuild -y | |
- name: Build rust-msi | |
run: | | |
cargo build --release --target x86_64-pc-windows-msvc | |
cargo build --release --target aarch64-pc-windows-msvc | |
cargo zigbuild --release --target x86_64-unknown-linux-gnu | |
cargo zigbuild --release --target aarch64-unknown-linux-gnu | |
working-directory: src/WingetCreateCore/Common/Msi/rust-msi | |
- run: dotnet publish ./WingetCreateCLI.csproj -c Release -r win-x64 --output ./output/win-x64 | |
working-directory: src/WingetCreateCLI | |
- run: dotnet publish ./WingetCreateCLI.csproj -c Release -r win-arm64 --output ./output/win-arm64 | |
working-directory: src/WingetCreateCLI | |
- run: dotnet publish ./WingetCreateCLI.csproj -c Release -r linux-x64 --output ./output/linux-x64 | |
working-directory: src/WingetCreateCLI | |
- run: dotnet publish ./WingetCreateCLI.csproj -c Release -r linux-arm64 --output ./output/linux-arm64 | |
working-directory: src/WingetCreateCLI | |
- name: Rename binaries according to os and arch | |
run: | | |
@('win-x64', 'win-arm64', 'linux-x64', 'linux-arm64') | % { | |
$wc = get-item -Path .\$_\WingetCreateCLI$(if($_.StartsWith("win")){".exe"}) | |
move-item $wc.fullname ./wingetcreate-$_$(if($_.StartsWith("win")){".exe"}) | |
} | |
working-directory: src/WingetCreateCLI/output | |
- name: Delete old release 🗑️ | |
run: | | |
gh api repos/$GITHUB_REPOSITORY/git/refs/tags/nightly | jq -r '.object.sha' | grep -q $GITHUB_SHA && exit 0 | |
gh release delete nightly -y --cleanup-tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
- uses: softprops/action-gh-release@v2 | |
with: | |
name: Nightly release 🌙 | |
tag_name: nightly | |
draft: false | |
files: src/WingetCreateCLI/output/wingetcreate-* | |
fail_on_unmatched_files: true | |
token: ${{ secrets.GITHUB_TOKEN }} |