mirror of
https://github.com/netbirdio/pfsense-netbird.git
synced 2026-05-22 18:04:30 -07:00
Build package(s) on upstream release (#24)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base"
|
||||
],
|
||||
"baseBranches": ["main", "update-ci"],
|
||||
"prConcurrentLimit": 5,
|
||||
"prHourlyLimit": 0,
|
||||
"labels": ["dependencies"],
|
||||
"automerge": false,
|
||||
"customManagers": [
|
||||
{
|
||||
"customType": "regex",
|
||||
"fileMatch": ["^netbird/Makefile$"],
|
||||
"matchStrings": [
|
||||
"DISTVERSION=\\s*(?<currentValue>\\d+\\.\\d+\\.\\d+)"
|
||||
],
|
||||
"datasourceTemplate": "github-releases",
|
||||
"depNameTemplate": "netbirdio/netbird",
|
||||
"versioningTemplate": "semver",
|
||||
"extractVersionTemplate": "^v(?<version>.*)$"
|
||||
}
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchDatasources": ["github-releases"],
|
||||
"matchDepNames": ["netbirdio/netbird"],
|
||||
"commitMessageTopic": "NetBird client",
|
||||
"commitMessageExtra": "to {{newVersion}}",
|
||||
"prTitle": "Update NetBird client to {{newVersion}}",
|
||||
"automergeType": "pr"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
name: Auto Release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- main
|
||||
- update-ci # Allow testing on this branch
|
||||
|
||||
jobs:
|
||||
auto-tag:
|
||||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'dependencies')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Extract NetBird version from Makefile
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(grep "^DISTVERSION=" netbird/Makefile | sed 's/DISTVERSION=\s*//')
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "tag=v${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if tag already exists
|
||||
id: check_tag
|
||||
run: |
|
||||
if git rev-parse "refs/tags/${{ steps.get_version.outputs.tag }}" >/dev/null 2>&1; then
|
||||
echo "exists=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "exists=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create and push tag
|
||||
if: steps.check_tag.outputs.exists == 'false'
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git tag -a ${{ steps.get_version.outputs.tag }} -m "Release ${{ steps.get_version.outputs.tag }}"
|
||||
git push origin ${{ steps.get_version.outputs.tag }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Comment on PR
|
||||
if: steps.check_tag.outputs.exists == 'false'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `✅ Release tag \`${{ steps.get_version.outputs.tag }}\` has been created and will trigger the build workflow.`
|
||||
})
|
||||
Reference in New Issue
Block a user