Skip to content

Commit ab47daa

Browse files
authored
Added workflow to trigger version bump on-demand
1 parent 78f0205 commit ab47daa

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

.github/workflows/auto-update.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Automatically create PR on a new version
22

33
on:
4-
schedule:
5-
- cron: '0 * * * *'
64
workflow_dispatch:
75

86
jobs:

.github/workflows/update.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Update Chocolatey package version
2+
3+
on:
4+
repository_dispatch:
5+
types: [new_netbird_version]
6+
7+
jobs:
8+
bump_version:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v4
13+
14+
- name: Capture the dispatched version
15+
id: set_version
16+
run: |
17+
if [ -z "${{ github.event.client_payload.version }}" ]; then
18+
echo "No version specified in payload!"
19+
exit 1
20+
fi
21+
echo "VERSION=${{ github.event.client_payload.version }}" >> $GITHUB_ENV
22+
23+
- name: Calculate SHA256 of the new MSI
24+
run: |
25+
URL="https://github.com/netbirdio/netbird/releases/download/v${{ env.VERSION }}/netbird_installer_${{ env.VERSION }}_windows_amd64.msi"
26+
echo "WIN64SHA=$(curl -sL $URL | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
27+
28+
- name: Update local files
29+
run: |
30+
sed -i "s|\$version .*|\$version = '${{ env.VERSION }}'|g" tools/chocolateyinstall.ps1
31+
sed -i "s/ checksum64 .*/ checksum64 = '${{ env.WIN64SHA }}'/g" tools/chocolateyinstall.ps1
32+
sed -i "s|version>.*<|version>${{ env.VERSION }}<|g" netbird.nuspec
33+
34+
- name: Create Pull Request
35+
uses: peter-evans/create-pull-request@v5
36+
with:
37+
token: ${{ secrets.PAT }}
38+
commit-message: "Bumping NetBird version to ${{ env.VERSION }}"
39+
committer: GitHub <[email protected]>
40+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
41+
signoff: false
42+
base: main
43+
branch: ${{ env.VERSION }}
44+
delete-branch: true
45+
title: "NetBird ${{ env.VERSION }}"
46+
body: "Bumped NetBird version to ${{ env.VERSION }}"
47+
labels: automerge
48+
49+
- name: Automerge Pull Request
50+
uses: reitermarkus/automerge@v2
51+
with:
52+
token: ${{ secrets.PAT }}
53+
required-labels: automerge

0 commit comments

Comments
 (0)