2021-04-17 04:02:33 +08:00
|
|
|
name: Build and Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: 'Netmaker version'
|
2022-03-10 23:10:32 +08:00
|
|
|
required: true
|
2021-04-17 04:02:33 +08:00
|
|
|
release:
|
2022-01-07 04:32:19 +08:00
|
|
|
types: [published]
|
2021-04-17 04:02:33 +08:00
|
|
|
|
|
|
|
jobs:
|
2022-03-11 23:03:29 +08:00
|
|
|
version:
|
2021-04-17 04:02:33 +08:00
|
|
|
runs-on: ubuntu-latest
|
2022-03-11 22:08:41 +08:00
|
|
|
outputs:
|
|
|
|
tag: ${{ steps.echo.outputs.tag }}
|
|
|
|
version: ${{ steps.echo.outputs.version }}
|
2021-04-17 04:02:33 +08:00
|
|
|
steps:
|
2022-03-09 22:05:49 +08:00
|
|
|
- name: Get Version Number
|
|
|
|
run: |
|
2022-03-12 06:41:46 +08:00
|
|
|
if [[ -n "${{ github.event.inputs.version }}" ]]; then
|
2021-04-17 04:02:33 +08:00
|
|
|
NETMAKER_VERSION=${{ github.event.inputs.version }}
|
|
|
|
else
|
|
|
|
NETMAKER_VERSION=$(curl -fsSL https://api.github.com/repos/gravitl/netmaker/tags | grep 'name' | head -1 | cut -d'"' -f4)
|
|
|
|
fi
|
|
|
|
echo "NETMAKER_VERSION=${NETMAKER_VERSION}" >> $GITHUB_ENV
|
2022-03-10 22:32:43 +08:00
|
|
|
# remove everything but digits and . for package (deb, rpm, etc) versions
|
2022-03-10 22:52:47 +08:00
|
|
|
PACKAGE_VERSION=$(echo ${NETMAKER_VERSION} | tr -cd '[:digit:].')
|
2022-03-10 22:32:43 +08:00
|
|
|
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
|
2022-03-10 22:51:36 +08:00
|
|
|
- name: Echo
|
2022-03-11 23:15:01 +08:00
|
|
|
id: echo
|
2022-03-10 22:51:36 +08:00
|
|
|
run: |
|
|
|
|
echo ${{ env.NETMAKER_VERSION }}
|
|
|
|
echo ${{ env.PACKAGE_VERSION }}
|
2022-03-11 22:45:30 +08:00
|
|
|
if [[ -z ${{ env.NETMAKER_VERSION }} || -z ${{ env.PACKAGE_VERSION }} ]]
|
2022-03-10 22:51:36 +08:00
|
|
|
then
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-03-11 22:25:55 +08:00
|
|
|
echo "::set-output name=tag::${{ env.NETMAKER_VERSION }}"
|
|
|
|
echo "::set-output name=version::${{ env.PACKAGE_VERSION }}"
|
2022-05-12 02:27:23 +08:00
|
|
|
netmaker:
|
2022-03-11 22:08:41 +08:00
|
|
|
runs-on: ubuntu-latest
|
2022-03-11 23:03:29 +08:00
|
|
|
needs: version
|
2022-03-11 22:08:41 +08:00
|
|
|
steps:
|
|
|
|
- name: set variables
|
|
|
|
run: |
|
2022-03-11 23:03:29 +08:00
|
|
|
echo ${{ needs.version.outputs.tag }} ${{ needs.version.outputs.version }}
|
|
|
|
TAG=${{needs.version.outputs.tag}}
|
|
|
|
VERSION=${{needs.version.outputs.version}}
|
|
|
|
if [[ -z ${VERSION} || -z ${TAG} ]]; then
|
2022-03-10 22:51:36 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-03-11 22:56:16 +08:00
|
|
|
echo "NETMAKER_VERSION=${TAG}" >> $GITHUB_ENV
|
|
|
|
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
2022-03-11 23:03:29 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-04-27 00:22:25 +08:00
|
|
|
go-version: 1.18
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Build
|
2022-03-11 22:25:55 +08:00
|
|
|
run: |
|
2022-03-11 22:08:41 +08:00
|
|
|
env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netmaker main.go
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload netmaker x86 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: build/netmaker
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netmaker
|
2022-03-11 22:08:41 +08:00
|
|
|
|
|
|
|
netclient-x86:
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-11 23:05:09 +08:00
|
|
|
needs: version
|
2022-03-11 22:08:41 +08:00
|
|
|
steps:
|
2021-04-17 04:02:33 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Set Variables
|
|
|
|
run: |
|
2022-03-11 23:05:09 +08:00
|
|
|
TAG=${{needs.version.outputs.tag}}
|
|
|
|
VERSION=${{needs.version.outputs.version}}
|
2022-03-11 23:20:36 +08:00
|
|
|
echo "NETMAKER_VERSION=${TAG}" >> $GITHUB_ENV
|
|
|
|
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
2021-04-17 04:02:33 +08:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-04-27 00:22:25 +08:00
|
|
|
go-version: 1.18
|
2022-05-06 04:14:34 +08:00
|
|
|
|
|
|
|
- name: Build cli
|
2021-04-17 04:02:33 +08:00
|
|
|
run: |
|
|
|
|
cd netclient
|
2022-03-04 05:19:25 +08:00
|
|
|
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient main.go
|
2022-05-06 04:14:34 +08:00
|
|
|
|
2022-03-10 05:52:56 +08:00
|
|
|
- name: Upload netclient x86 to Release
|
2022-03-10 20:49:47 +08:00
|
|
|
continue-on-error: true
|
2022-03-09 22:07:25 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient
|
2022-01-20 08:09:22 +08:00
|
|
|
|
2022-05-06 04:14:34 +08:00
|
|
|
- name: build gui
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
|
2022-05-12 02:27:23 +08:00
|
|
|
go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-gui .
|
2022-05-06 04:14:34 +08:00
|
|
|
|
|
|
|
- name: Upload netclient x86 gui to Release
|
|
|
|
continue-on-error: true
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-12 02:27:23 +08:00
|
|
|
file: netclient/build/netclient-gui
|
2022-05-06 04:14:34 +08:00
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-gui
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-10 04:28:39 +08:00
|
|
|
- name: Package x86 deb
|
2022-03-10 20:49:47 +08:00
|
|
|
continue-on-error: true
|
2022-03-10 04:28:39 +08:00
|
|
|
uses: gravitl/github-action-fpm@master
|
|
|
|
with:
|
|
|
|
fpm_args: './netclient/build/netclient=/sbin/netclient ./netclient/build/netclient.service=/lib/systemd/system/netclient.service'
|
2022-03-10 23:10:32 +08:00
|
|
|
fpm_opts: '-s dir -t deb --architecture amd64 --version ${{ env.PACKAGE_VERSION }}'
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-10 04:28:39 +08:00
|
|
|
- name: Upload x86 deb to Release
|
2022-03-10 20:49:47 +08:00
|
|
|
continue-on-error: true
|
2022-03-10 04:28:39 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient_${{ env.PACKAGE_VERSION }}_amd64.deb
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient_${{ env.PACKAGE_VERSION }}_amd64.deb
|
|
|
|
|
|
|
|
- name: Package x86 rpm
|
2022-03-10 20:49:47 +08:00
|
|
|
continue-on-error: true
|
2022-03-10 04:28:39 +08:00
|
|
|
uses: gravitl/github-action-fpm@master
|
|
|
|
with:
|
|
|
|
fpm_args: './netclient/build/netclient=/sbin/netclient ./netclient/build/netclient.service=/lib/systemd/system/netclient.service'
|
|
|
|
fpm_opts: '-s dir -t rpm --architecture amd64 --version ${{ env.PACKAGE_VERSION }}'
|
2022-05-12 02:27:23 +08:00
|
|
|
|
2022-03-10 04:28:39 +08:00
|
|
|
- name: Upload x86 rpm to Release
|
2022-03-10 20:49:47 +08:00
|
|
|
continue-on-error: true
|
2022-03-10 04:28:39 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-12 02:27:23 +08:00
|
|
|
file: netclient-${{ env.PACKAGE_VERSION }}-1.x86_64.rpm
|
2022-03-10 04:28:39 +08:00
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
2022-03-10 23:10:32 +08:00
|
|
|
asset_name: netclient-${{ env.PACKAGE_VERSION }}-1.x86_64.rpm
|
2022-03-10 04:28:39 +08:00
|
|
|
|
2022-03-10 05:52:56 +08:00
|
|
|
- name: Package x86 pacman
|
2022-03-10 20:49:47 +08:00
|
|
|
continue-on-error: true
|
2022-03-10 05:52:56 +08:00
|
|
|
uses: gravitl/github-action-fpm@master
|
|
|
|
with:
|
|
|
|
# arch has particular path requirements --- cannot write to a symbolic link e.g. /sbin and /lib
|
|
|
|
fpm_args: './netclient/build/netclient=/usr/bin/netclient ./netclient/build/netclient.service=/usr/lib/systemd/system/netclient.service'
|
2022-03-10 23:10:32 +08:00
|
|
|
fpm_opts: '-s dir -t pacman --architecture amd64 --version ${{ env.PACKAGE_VERSION }}'
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-10 05:52:56 +08:00
|
|
|
- name: Upload x86 pacman to Release
|
2022-03-10 20:49:47 +08:00
|
|
|
continue-on-error: true
|
2022-03-10 05:52:56 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-11 23:46:29 +08:00
|
|
|
file: netclient-${{ env.PACKAGE_VERSION }}-1-x86_64.pkg.tar.zst
|
2022-03-10 05:52:56 +08:00
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
2022-03-11 23:46:29 +08:00
|
|
|
asset_name: netclient-${{ env.PACKAGE_VERSION }}-1-x86_64.pkg.tar.zst
|
2022-03-10 05:52:56 +08:00
|
|
|
|
2022-03-11 22:08:41 +08:00
|
|
|
netclient-arm:
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-11 23:05:09 +08:00
|
|
|
needs: version
|
2022-03-11 22:08:41 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set Variables
|
|
|
|
run: |
|
2022-03-11 23:05:09 +08:00
|
|
|
TAG=${{needs.version.outputs.tag}}
|
|
|
|
VERSION=${{needs.version.outputs.version}}
|
2022-03-11 23:20:36 +08:00
|
|
|
echo "NETMAKER_VERSION=${TAG}" >> $GITHUB_ENV
|
|
|
|
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v2
|
2022-03-10 04:28:39 +08:00
|
|
|
with:
|
2022-04-27 00:22:25 +08:00
|
|
|
go-version: 1.18
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd netclient
|
|
|
|
env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-arm5/netclient main.go
|
|
|
|
env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-arm6/netclient main.go
|
|
|
|
env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-arm7/netclient main.go
|
|
|
|
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-arm64/netclient main.go
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Upload arm5 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
2022-05-12 02:27:23 +08:00
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-11 23:37:41 +08:00
|
|
|
file: netclient/build/netclient-arm5/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
2022-05-12 02:27:23 +08:00
|
|
|
overwrite: true
|
2022-03-10 04:28:39 +08:00
|
|
|
prerelease: true
|
2022-03-11 22:08:41 +08:00
|
|
|
asset_name: netclient-arm5
|
2022-03-10 04:28:39 +08:00
|
|
|
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Upload arm6 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
2022-05-12 02:27:23 +08:00
|
|
|
with:
|
2022-03-11 22:25:55 +08:00
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-arm6/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-arm6
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload arm7 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-arm7/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-arm7
|
2022-05-12 02:27:23 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload arm64 to Release
|
|
|
|
continue-on-error: true
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-arm64/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-arm64
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Package arm64 deb
|
|
|
|
continue-on-error: true
|
|
|
|
uses: gravitl/github-action-fpm@master
|
|
|
|
with:
|
|
|
|
fpm_args: './netclient/build/netclient-arm64/netclient=/sbin/netclient ./netclient/build/netclient.service=/lib/systemd/netclient.service'
|
|
|
|
fpm_opts: '-s dir -t deb --architecture arm64 --version ${{ env.PACKAGE_VERSION }}'
|
|
|
|
- name: Upload arm deb to Release
|
|
|
|
continue-on-error: true
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient_${{ env.PACKAGE_VERSION }}_arm64.deb
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient_${{ env.PACKAGE_VERSION }}_arm64.deb
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Package arm64 rpm
|
|
|
|
continue-on-error: true
|
|
|
|
uses: gravitl/github-action-fpm@master
|
|
|
|
with:
|
|
|
|
fpm_args: './netclient/build/netclient-arm64/netclient=/sbin/netclient ./netclient/build/netclient.service=/lib/systemd/netclient.service'
|
|
|
|
fpm_opts: '-s dir -t rpm --architecture arm64 --version ${{ env.PACKAGE_VERSION }}'
|
2022-05-07 02:33:59 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload arm64 rpm to Release
|
|
|
|
continue-on-error: true
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient-${{ env.PACKAGE_VERSION }}-1.aarch64.rpm
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
2022-06-03 02:32:25 +08:00
|
|
|
asset_name: netclient-${{ env.PACKAGE_VERSION }}-1.aarch64.rpm
|
2022-03-11 22:08:41 +08:00
|
|
|
|
|
|
|
netclient-mipsle:
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-11 23:05:09 +08:00
|
|
|
needs: version
|
2022-03-11 22:08:41 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set Variables
|
|
|
|
run: |
|
2022-03-11 23:05:09 +08:00
|
|
|
TAG=${{needs.version.outputs.tag}}
|
|
|
|
VERSION=${{needs.version.outputs.version}}
|
2022-03-11 23:20:36 +08:00
|
|
|
echo "NETMAKER_VERSION=${TAG}" >> $GITHUB_ENV
|
|
|
|
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v2
|
2022-03-10 04:28:39 +08:00
|
|
|
with:
|
2022-03-27 23:27:40 +08:00
|
|
|
go-version: 1.18
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd netclient
|
|
|
|
env CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build -ldflags "-s -w -X 'main.version=$NETMAKER_VERSION'" -o build/netclient-mipsle/netclient main.go && upx build/netclient-mipsle/netclient
|
2022-05-07 03:24:07 +08:00
|
|
|
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Upload mipsle to Release
|
2022-03-11 22:25:55 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-mipsle/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-mipsle
|
2022-05-12 02:27:23 +08:00
|
|
|
|
2022-03-11 22:08:41 +08:00
|
|
|
netclient-freebsd:
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-11 23:05:09 +08:00
|
|
|
needs: version
|
2022-03-11 22:08:41 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set Variables
|
|
|
|
run: |
|
2022-03-11 23:05:09 +08:00
|
|
|
TAG=${{needs.version.outputs.tag}}
|
|
|
|
VERSION=${{needs.version.outputs.version}}
|
2022-03-11 23:20:36 +08:00
|
|
|
echo "NETMAKER_VERSION=${TAG}" >> $GITHUB_ENV
|
|
|
|
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-03-27 23:27:40 +08:00
|
|
|
go-version: 1.18
|
2022-03-11 22:08:41 +08:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd netclient
|
2022-07-09 03:16:32 +08:00
|
|
|
env CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-freebsd/netclient .
|
|
|
|
env CGO_ENABLED=0 GOOS=freebsd GOARCH=arm GOARM=5 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-freebsd-arm5/netclient .
|
|
|
|
env CGO_ENABLED=0 GOOS=freebsd GOARCH=arm GOARM=6 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-freebsd-arm6/netclient .
|
|
|
|
env CGO_ENABLED=0 GOOS=freebsd GOARCH=arm GOARM=7 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-freebsd-arm7/netclient .
|
|
|
|
env CGO_ENABLED=0 GOOS=freebsd GOARCH=arm64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-freebsd-arm64/netclient .
|
2022-03-11 22:08:41 +08:00
|
|
|
|
|
|
|
- name: Upload freebsd to Release
|
2022-03-11 22:25:55 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-freebsd/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
2022-05-12 02:27:23 +08:00
|
|
|
asset_name: netclient-freebsd
|
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload freebsd-arm5 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-freebsd-arm5/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-freebsd-arm5
|
2022-05-12 02:27:23 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload freebsd-arm6 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-freebsd-arm6/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-freebsd-arm6
|
2022-05-12 02:27:23 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload freebsd-arm7 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-freebsd-arm7/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-freebsd-arm7
|
2022-05-12 02:27:23 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload freebsd-arm64 to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-freebsd-arm64/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-freebsd-arm64
|
2022-03-11 22:08:41 +08:00
|
|
|
|
|
|
|
netclient-darwin:
|
2022-05-06 04:14:34 +08:00
|
|
|
runs-on: macos-latest
|
2022-03-11 23:05:09 +08:00
|
|
|
needs: version
|
2022-03-11 22:08:41 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set Variables
|
|
|
|
run: |
|
2022-03-11 23:05:09 +08:00
|
|
|
TAG=${{needs.version.outputs.tag}}
|
|
|
|
VERSION=${{needs.version.outputs.version}}
|
2022-03-11 23:20:36 +08:00
|
|
|
echo "NETMAKER_VERSION=${TAG}" >> $GITHUB_ENV
|
|
|
|
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
2022-05-12 02:27:23 +08:00
|
|
|
- name: Setup go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-03-27 23:27:40 +08:00
|
|
|
go-version: 1.18
|
2022-05-12 02:27:23 +08:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd netclient
|
|
|
|
env GOOS=darwin GOARCH=amd64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin/netclient .
|
2022-05-17 04:42:42 +08:00
|
|
|
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin-arm64/netclient main.go
|
2022-09-14 20:17:35 +08:00
|
|
|
env GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin/netclient-darwin-nogui .
|
2022-05-06 04:14:34 +08:00
|
|
|
- name: Upload darwin-amd64 to Release
|
2022-03-10 04:28:39 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-11 22:08:41 +08:00
|
|
|
file: netclient/build/netclient-darwin/netclient
|
2022-03-10 04:28:39 +08:00
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
2022-03-11 22:08:41 +08:00
|
|
|
asset_name: netclient-darwin
|
2022-03-10 04:28:39 +08:00
|
|
|
|
2022-03-11 22:25:55 +08:00
|
|
|
- name: Upload darwin-arm64 to Release
|
2022-03-10 04:28:39 +08:00
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-11 22:08:41 +08:00
|
|
|
file: netclient/build/netclient-darwin-arm64/netclient
|
2022-03-10 04:28:39 +08:00
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
2022-03-11 22:08:41 +08:00
|
|
|
asset_name: netclient-darwin-arm64
|
2022-09-14 20:17:35 +08:00
|
|
|
|
|
|
|
- name: Upload darwin-nogui to Release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient-darwin-nogui/netclient
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
|
|
|
asset_name: netclient-darwin-nogui
|
|
|
|
|
2022-03-30 19:21:27 +08:00
|
|
|
netclient-windows:
|
2022-05-06 04:14:34 +08:00
|
|
|
runs-on: windows-latest
|
2022-03-30 19:21:27 +08:00
|
|
|
needs: version
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set Variables
|
|
|
|
run: |
|
|
|
|
TAG=${{needs.version.outputs.tag}}
|
|
|
|
VERSION=${{needs.version.outputs.version}}
|
|
|
|
echo "NETMAKER_VERSION=${TAG}" >> $GITHUB_ENV
|
|
|
|
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
2022-05-06 04:25:05 +08:00
|
|
|
shell: bash
|
2022-03-30 19:21:27 +08:00
|
|
|
- name: Setup go
|
2022-05-10 01:32:23 +08:00
|
|
|
uses: actions/setup-go@v3
|
2022-03-30 19:21:27 +08:00
|
|
|
with:
|
2022-04-27 00:22:25 +08:00
|
|
|
go-version: 1.18
|
2022-05-10 02:42:39 +08:00
|
|
|
- name: Mysys2 setup
|
|
|
|
uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
|
|
|
install: >-
|
|
|
|
git
|
|
|
|
mingw-w64-x86_64-toolchain
|
2022-03-30 19:21:27 +08:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-05-09 23:35:07 +08:00
|
|
|
echo $(go env GOPATH)/bin >> $GITHUB_PATH
|
2022-03-30 19:21:27 +08:00
|
|
|
cd netclient
|
2022-05-10 02:25:40 +08:00
|
|
|
go get -v github.com/josephspurrier/goversioninfo
|
2022-05-10 02:01:59 +08:00
|
|
|
go install -v github.com/josephspurrier/goversioninfo/cmd/goversioninfo
|
2022-05-07 02:33:59 +08:00
|
|
|
go generate
|
2022-05-12 02:27:23 +08:00
|
|
|
go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient.exe .
|
2022-05-06 04:14:34 +08:00
|
|
|
|
2022-03-30 19:21:27 +08:00
|
|
|
- name: Upload netclient windows to Release
|
|
|
|
continue-on-error: true
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: netclient/build/netclient.exe
|
|
|
|
tag: ${{ env.NETMAKER_VERSION }}
|
|
|
|
overwrite: true
|
|
|
|
prerelease: true
|
2022-03-30 19:26:14 +08:00
|
|
|
asset_name: netclient.exe
|
2022-05-05 19:51:13 +08:00
|
|
|
|
|
|
|
linux-packages:
|
|
|
|
runs-on: ubuntu-latest
|
2022-05-12 02:44:27 +08:00
|
|
|
needs: [version, netclient-x86, netclient-arm]
|
2022-05-05 19:51:13 +08:00
|
|
|
steps:
|
|
|
|
- name: Repository Dispatch
|
|
|
|
uses: peter-evans/repository-dispatch@v2.0.0
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.PERS_TOKEN_FOR_NETMAKER_DEVOPS}}
|
|
|
|
repository: gravitl/netmaker-devops
|
|
|
|
event-type: build-packages
|
|
|
|
client-payload: '{"VERSION": "${{ env.PACKAGE_VERSION }}"}'
|