Skip to content

Commit 61b0a22

Browse files
authored
Merge pull request #386 from chrisbra/winget-get-release-name
Get the correct tag to be used with winget-releaser
2 parents 04c84af + 7df04f0 commit 61b0a22

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

.github/workflows/winget_nightly.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,23 @@ jobs:
1010
publish:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: vedantmgoyal9/winget-releaser@main
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Needed to fetch all tags
17+
18+
- name: Get latest tag
19+
id: get-version
20+
run: |
21+
git fetch --tags
22+
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
23+
echo "Latest tag: $latest_tag"
24+
echo "version=${latest_tag#v}" >> "$GITHUB_OUTPUT"
25+
26+
- name: Run winget-releaser
27+
uses: vedantmgoyal9/winget-releaser@main
1428
with:
1529
identifier: vim.vim.nightly
1630
installers-regex: 'gvim.*(x64|x86|arm64).exe$'
31+
version: ${{ steps.get-version.outputs.version }}
1732
token: ${{ secrets.WINGET_TOKEN }}

.github/workflows/winget_stable.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,27 @@ jobs:
1212

1313
outputs:
1414
needs_update: ${{ steps.check-updates.outputs.result }}
15+
version: ${{ steps.get-version.outputs.version }}
1516

1617
steps:
1718
- uses: actions/checkout@v4
1819
with:
1920
path: repo
21+
fetch-depth: 0 # Needed to fetch all tags
22+
23+
- name: Get latest tag
24+
id: get-version
25+
run: |
26+
cd repo
27+
git fetch --tags
28+
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
29+
echo "Latest tag: $latest_tag"
30+
echo "version=${latest_tag#v}" >> "$GITHUB_OUTPUT"
2031
2132
- name: Check updates
2233
id: check-updates
2334
run: |
2435
cd repo
25-
# only for debugging
26-
#
27-
# bash -x scripts/get_last_windows_release.sh "$URL" || true
28-
# bash -x scripts/do_next_stable_release.sh || true
2936
echo "result=$(scripts/do_next_stable_release.sh $URL)" >> "$GITHUB_OUTPUT"
3037
env:
3138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -41,3 +48,4 @@ jobs:
4148
identifier: vim.vim
4249
installers-regex: 'gvim.*(x64|x86|arm64).exe$'
4350
token: ${{ secrets.WINGET_TOKEN }}
51+
version: ${{ needs.check-update-job.outputs.version }}

0 commit comments

Comments
 (0)