Repository navigation
50 lines (44 loc) · 2.36 KB
/
Copy pathwinget-update.yml
File metadata and controls
50 lines (44 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Update nextest on WinGet
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # Scheduled to run daily at 03:00
permissions:
contents: read
jobs:
update:
name: Update nextest on WinGet
environment: winget
runs-on: ubuntu-latest
steps:
- name: Sync winget-pkgs
uses: michidk/run-komac@9b27eadc6e9235c252444a437d246c139da2f57f # v2.1.0
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@9b27eadc6e9235c252444a437d246c139da2f57f # v2.1.0
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
environment: winget
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@9b27eadc6e9235c252444a437d246c139da2f57f # v2.1.0
with:
args: "cleanup --only-merged --token=${{ secrets.KOMAC_TOKEN }}"
custom-fork-owner: nextest-rs