Skip to content

Commit

Permalink
xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-hajek committed Jun 5, 2020
1 parent 1ccf73f commit e4ad0af
Showing 1 changed file with 23 additions and 40 deletions.
63 changes: 23 additions & 40 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,41 @@ on:

jobs:
build:
name: Upload build asset
runs-on: ubuntu-latest
name: Upload build asset for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
buildCmd: env GOOS=linux GOARCH=amd64 go build -o zcli-linux ./main.go
file: zcli-linux
args: --better
strip: true
- os: macos-latest
buildCmd: env GOOS=darwin GOARCH=amd64 go build -o zcli-mac ./main.go
file: zcli-mac
args: --better
strip: true

steps:

- name: Checkout code
uses: actions/checkout@v2

- name: Build project for linux
run: env GOOS=linux GOARCH=amd64 go build -o zcli-linux ./main.go

- name: Compress linux binary
uses: svenstaro/upx-action@v1-release
with:
file: ./zcli-linux

- name: Build project for mac
run: env GOOS=darwin GOARCH=amd64 go build -o zcli-mac ./main.go
- name: Build
run: ${{ matrix.buildCmd }}

- name: Compress mac binary
- name: Compress binary
uses: svenstaro/upx-action@v1-release
with:
file: ./zcli-mac
file: ./${{ matrix.file }}

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload linux asset
id: upload-linux-asset
- name: Upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./zcli-linux
asset_name: zcli-linux
asset_path: ./${{ matrix.file }}
asset_name: ${{ matrix.file }}
asset_content_type: application/octet-stream

- name: Upload mac asset
id: upload-mac-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./zcli-mac
asset_name: zcli-mac
asset_content_type: application/octet-stream

0 comments on commit e4ad0af

Please sign in to comment.