Update nightly.yml #106
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: Build rust-msi | |
run: | | |
rustup target add aarch64-pc-windows-msvc | |
cargo build --release --target x86_64-pc-windows-msvc | |
cargo build --release --target aarch64-pc-windows-msvc | |
$cmdstr = 'cargo zigbuild --release --target x86_64-unknown-linux-gnu && ' + | |
'cargo zigbuild --release --target aarch64-unknown-linux-gnu && ' + | |
'cargo zigbuild --target aarch64-apple-darwin' | |
docker run --rm -v ${pwd}:c:\io -w c:\io vedantmgoyal/cargo-zigbuild.windows:main cmd /c $cmdstr | |
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 | |
- run: dotnet publish ./WingetCreateCLI.csproj -c Release -r osx-arm64 --output ./output/osx-arm64 | |
working-directory: src/WingetCreateCLI | |
- name: Rename binaries according to os and arch | |
run: | | |
@('win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-arm64') | % { | |
$wc = get-item -Path .\$_\WingetCreateCLI$(if($_.StartsWith("win")){".exe"}) | |
move-item $wc.fullname ./wingetcreate-$_$(if($_.StartsWith("win")){".exe"}) | |
} | |
move-item ./wingetcreate-osx-arm64 ./wingetcreate-macos-arm64 | |
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 }} |