Skip to content

Merge pull request #64 from jumpserver/pr@master@perf_gh_action #51

Merge pull request #64 from jumpserver/pr@master@perf_gh_action

Merge pull request #64 from jumpserver/pr@master@perf_gh_action #51

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build And Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
create_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version
id: get_version
run: |
TAG=$(basename ${GITHUB_REF})
VERSION=${TAG/v/}
echo "::set-output name=TAG::$TAG"
echo "::set-output name=VERSION::$VERSION"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
- uses: actions/setup-go@v5
with:
go-version: 'stable' # The Go version to download (if necessary) and use.
- name: Install objcopy for cross-arch binaries
run: |
sudo apt-get update
sudo apt-get install -y binutils binutils-aarch64-linux-gnu
GOVERSION=$(go version | awk '{print $3}')
echo "GOVERSION=${GOVERSION}" >> $GITHUB_ENV
- name: Build Binary
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}