Skip to content

Release Netclient

Release Netclient #5

Workflow file for this run

name: Release Netclient
on:
workflow_dispatch:
inputs:
version:
required: true
description: "new version number"
type: string
jobs:
release-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: deweb-services/netclient
ref: develop
- name: setup go
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Setup git
run: |
git config --global user.name "Gravitl"
git config --global user.email "[email protected]"
- name: Create Release Branch
run: |
git switch -c release-${{ inputs.version }}
- name: Fix go mod
run: |
go get github.com/gravitl/[email protected]
go mod tidy
git commit -am 'update go mod for release'
- name: Fetch Secrets
uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.BW_PIPELINE_ACCESS_TOKEN }}
secrets: |
73fd78b1-23c6-446a-afdd-b16400945670 > GITHUB_TOKEN
- name: Update Release Branch
run: |
git tag -f ${{ inputs.version }}
git push origin release-${{ inputs.version }}
git push origin ${{ inputs.version }}
release-assets:
needs: release-branch
runs-on: ubuntu-latest
steps:
- name: Fetch Secrets
uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.BW_PIPELINE_ACCESS_TOKEN }}
secrets: |
73fd78b1-23c6-446a-afdd-b16400945670 > GITHUB_TOKEN
- name: Checkout
uses: actions/checkout@v3
with:
repository: deweb-services/netclient
ref: release-${{ inputs.version }}
fetch-depth: 0
- name: Get Tags
run: |
git fetch --force --tags
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
args: release --clean --release-notes release.md
docker:
needs: release-branch
runs-on: ubuntu-latest
steps:
- name: Fetch Secrets
uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.BW_PIPELINE_ACCESS_TOKEN }}
secrets: |
36f7899e-da1c-47a1-bfaa-b16300eee9f3 > REGISTRY_USER
55987f21-7148-48e2-b88c-b17f00791f98 > REGISTRY_PASSWORD
- name: Checkout
uses: actions/checkout@v3
with:
repository: deweb-services/netclient
ref: release-${{ inputs.version }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64, linux/arm/v7
push: true
tags: |
deweb-services/netclient:${{ inputs.version }}
deweb-services/netclient:latest
pull-request:
needs: release-branch
runs-on: ubuntu-latest
steps:
- name: Fetch Secrets
uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.BW_PIPELINE_ACCESS_TOKEN }}
secrets: |
73fd78b1-23c6-446a-afdd-b16400945670 > GITHUB_TOKEN
- name: create pr
env:
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
run: |
gh api --method POST \
-H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' \
/repos/deweb-services/netclient/pulls \
-f title='${{ inputs.version }}' \
-f head='release-${{ inputs.version }}' \
-f base="master"