Update nextest on WinGet #89
This file contains hidden or 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: Update nextest on WinGet | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 3 * * *" # Scheduled to run daily at 03:00 | |
| jobs: | |
| update: | |
| name: Update nextest on WinGet | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Sync winget-pkgs | |
| uses: michidk/run-komac@latest | |
| with: | |
| args: "sync --token=${{ secrets.KOMAC_TOKEN }}" | |
| custom-fork-owner: nextest-rs | |
| - name: Get latest nextest version | |
| id: get_latest_version | |
| run: | | |
| latest_tag=$(git ls-remote --tags --sort=-version:refname https://github.com/nextest-rs/nextest.git 'cargo-nextest-*' | grep -Eo 'cargo-nextest-[0-9]+\.[0-9]+\.[0-9]+$' | head -n1) | |
| latest_version=${latest_tag#cargo-nextest-} | |
| echo "LATEST_VERSION=${latest_version}" >> $GITHUB_ENV | |
| echo "URLS=https://github.com/nextest-rs/nextest/releases/download/${latest_tag}/${latest_tag}-aarch64-pc-windows-msvc.zip https://github.com/nextest-rs/nextest/releases/download/${latest_tag}/${latest_tag}-i686-pc-windows-msvc.zip https://github.com/nextest-rs/nextest/releases/download/${latest_tag}/${latest_tag}-x86_64-pc-windows-msvc.zip" >> $GITHUB_ENV | |
| # We run komac ourselves because the current version of | |
| # michidk/winget-updater as of this writing (1.1.6) doesn't support | |
| # a custom version (which we need above). | |
| - name: Update nextest on WinGet | |
| uses: michidk/run-komac@latest | |
| with: | |
| args: "update nextest.cargo-nextest --version $LATEST_VERSION --urls $URLS --submit --token ${{ secrets.KOMAC_TOKEN }}" | |
| custom-fork-owner: nextest-rs | |
| cleanup: | |
| name: Cleanup branches | |
| needs: update # Not necessarily needed as PRs don't get closed that quick but still nice to have it in order | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Run Komac | |
| uses: michidk/run-komac@latest | |
| with: | |
| args: "cleanup --only-merged --token=${{ secrets.KOMAC_TOKEN }}" | |
| custom-fork-owner: nextest-rs |