Skip to content

Commit

Permalink
ci(github): update goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Oct 15, 2024
1 parent d4a83f2 commit f6bd717
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,84 @@ jobs:
target/wix/komorebi-*.msi
retention-days: 14

# TODO: figure out multi-arch goreleaser check

nightly:
name: Nightly2
needs: build2
runs-on: windows-latest
permissions: write-all
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/download-artifact@v4
- if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' }}
run: |
Compress-Archive .\target\x86-64-pc-windows-msvc\release\*.exe komorebi-nightly-x86_64-pc-windows-msvc.zip
Copy-Item ./target/wix/*x86-64.msi -Destination ./komorebi-nightly-x86_64.msi
echo "$((Get-FileHash komorebi-nightly-x86_64-pc-windows-msvc.zip).Hash.ToLower()) komorebi-nightly-x86_64-pc-windows-msvc.zip" >checksums.txt
Compress-Archive .\target\aarch64-pc-windows-msvc\release\*.exe komorebi-nightly-aarch64-pc-windows-msvc.zip
Copy-Item ./target/wix/*aarch64.msi -Destination ./komorebi-nightly-aarch64.msi
echo "$((Get-FileHash komorebi-nightly-aarch64-pc-windows-msvc.zip).Hash.ToLower()) komorebi-nightly-aarch64-pc-windows-msvc.zip" >>checksums.txt
- if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' }}
shell: bash
run: |
gh release delete nightly --yes || true
git push origin :nightly || true
gh release create nightly \
--target $GITHUB_SHA \
--prerelease \
--title "komorebi nightly (${GITHUB_SHA})" \
--notes "This nightly release of komorebi corresponds to [this commit](https://github.com/LGUG2Z/komorebi/commit/${GITHUB_SHA})." \
komorebi-nightly-x86_64-pc-windows-msvc.zip \
komorebi-nightly-x86_64.msi \
komorebi-nightly-aarch64-pc-windows-msvc.zip \
komorebi-nightly-aarch64.msi \
checksums.txt
release2:
needs: build2
runs-on: windows-latest
permissions: write-all
env:
GH_TOKEN: ${{ github.token }}
steps:
- if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
TAG=${{ github.event.release.tag_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- if: startsWith(github.ref, 'refs/tags/v')
uses: actions/download-artifact@v4
- if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'schedule' }}
run: |
Compress-Archive .\target\x86-64-pc-windows-msvc\release\*.exe komorebi-$Env:VERSION-x86_64-pc-windows-msvc.zip
Copy-Item ./target/wix/*x86-64.msi -Destination ./komorebi-$Env:VERSION-x86_64.msi
echo "$((Get-FileHash komorebi-$Env:VERSION-x86_64-pc-windows-msvc.zip).Hash.ToLower()) komorebi-$Env:VERSION-x86_64-pc-windows-msvc.zip" >checksums.txt
Compress-Archive .\target\aarch64-pc-windows-msvc\release\*.exe komorebi-$Env:VERSION-aarch64-pc-windows-msvc.zip
Copy-Item ./target/wix/*aarch64.msi -Destination ./komorebi-$Env:VERSION-aarch64.msi
echo "$((Get-FileHash komorebi-$Env:VERSION-aarch64-pc-windows-msvc.zip).Hash.ToLower()) komorebi-$Env:VERSION-aarch64-pc-windows-msvc.zip" >>checksums.txt
- if: startsWith(github.ref, 'refs/tags/v')
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
cache-all-crates: "true"
- if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: |
if ! type kokai >/dev/null; then cargo install --locked kokai --force; fi
git tag -d nightly
kokai release --no-emoji --add-links github:commits,issues --ref "$(git tag --points-at HEAD)" >"CHANGELOG.md"
- uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
body_path: "CHANGELOG.md"
files: |
*.zip
*.msi
build:
name: Build
runs-on: windows-latest
Expand Down
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Adapted from https://jondot.medium.com/shipping-rust-binaries-with-goreleaser-d5aa42a46be0
version: 2
project_name: komorebi

before:
Expand Down
2 changes: 1 addition & 1 deletion wix/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<Product Id='*' Name='komorebi' UpgradeCode='F8B967B5-7E7B-4E3A-895B-B789EC898B54' Manufacturer='LGUG2Z' Language='1033' Codepage='1252' Version='$(var.Version)'>

<Package Id='*' Keywords='Installer' Description='A tiling window manager for Windows' Manufacturer='LGUG2Z' InstallerVersion='450' Languages='1033' Compressed='yes' InstallScope='perMachine' SummaryCodepage='1252' />
<Package Id='*' Keywords='Installer' Description='A tiling window manager for Windows' Manufacturer='LGUG2Z' InstallerVersion='500' Languages='1033' Compressed='yes' InstallScope='perMachine' SummaryCodepage='1252' />

<MajorUpgrade Schedule='afterInstallInitialize' DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.' />

Expand Down

0 comments on commit f6bd717

Please sign in to comment.