Skip to content

Commit

Permalink
release github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrsalah committed Apr 11, 2021
1 parent 2589f45 commit 75e02a4
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
strategy:
matrix:
go_version: [1.16.x]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go 1.16
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go_version }}
- name: Test Pre-Publish
run: make test
- name: Build with xgo
uses: crazy-max/ghaction-xgo@v1
with:
xgo_version: latest
go_version: ${{ matrix.go_version }}
dest: build
prefix: pkt
targets: windows/386,windows/amd64,linux/386,linux/amd64,darwin/386,darwin/amd64
v: true
x: false
pkg: cmd/pkt
ldflags: -s -w
- name: Create Release
uses: actions/create-release@v1.0.0
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Assets
uses: glentiki/xbin-release-action@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
assets_path: ./build

0 comments on commit 75e02a4

Please sign in to comment.