Skip to content

v0.30.1

v0.30.1 #154

Workflow file for this run

name: Release
on:
workflow_dispatch:
release:
types: [ published ]
branches: [ master ]
jobs:
build_assets:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
id: go
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: |
chmod +x build.assets.sh
./build.assets.sh
- name: Get NPS version
id: version
run: |
if [ -f "lib/version/version.go" ]; then
version=$(grep -oP '(?<=const VERSION = ")[^"]*' lib/version/version.go)
echo "NPS version: $version"
echo "NPS_VERSION=$version" >> $GITHUB_ENV
fi
- name: Upload
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
with:
tag_name: v${{ env.NPS_VERSION }}
files: "*.tar.gz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger Update NPS Client
run: |
curl -X POST https://api.github.com/repos/djylb/npsclient/dispatches \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" \
-d '{"event_type":"trigger-update"}'
- name: Trigger Update NPS OpenWRT
run: |
curl -X POST https://api.github.com/repos/djylb/nps-openwrt/dispatches \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" \
-d '{"event_type":"trigger-update"}'
- name: Trigger Sync to nps-mirror
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
run: |
curl -X POST https://api.github.com/repos/djylb/nps-mirror/dispatches \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" \
-d '{
"event_type": "sync_nps_release",
"client_payload": {
"tag": "v${{ env.NPS_VERSION }}"
}
}'
build_assets_old:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
check-latest: true
id: go
- name: Setup the patched Go version for Windows 7
run: |
GOSDK=$(go env GOROOT)
rm -r $GOSDK/*
cd $GOSDK
curl -O -L https://github.com/XTLS/go-win7/releases/latest/download/go-for-win7-linux-amd64.zip
unzip ./go-for-win7-linux-amd64.zip -d $GOSDK
rm ./go-for-win7-linux-amd64.zip
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: |
chmod +x build.assets.old.sh
./build.assets.old.sh
- name: Get NPS version
id: version
run: |
if [ -f "lib/version/version.go" ]; then
version=$(grep -oP '(?<=const VERSION = ")[^"]*' lib/version/version.go)
echo "NPS version: $version"
echo "NPS_VERSION=$version" >> $GITHUB_ENV
fi
- name: Upload
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
with:
tag_name: v${{ env.NPS_VERSION }}
files: "*.tar.gz"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}