Created
November 15, 2019 19:49
-
-
Save egeneralov/87614c8c4e458e5e973bd6bb27819a62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| name: Release | |
| jobs: | |
| build: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@master | |
| - name: build linux | |
| run: GOOS=linux go build -v -o PROJECT_NAME_HERE-linux . | |
| - name: build darwin | |
| run: GOOS=darwin go build -v -o PROJECT_NAME_HERE-darwin . | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: false | |
| prerelease: false | |
| - name: save linux artifact in Actions | |
| uses: actions/[email protected] | |
| with: | |
| name: linux | |
| path: PROJECT_NAME_HERE-linux | |
| - name: save darwin artifact in Actions | |
| uses: actions/[email protected] | |
| with: | |
| name: darwin | |
| path: PROJECT_NAME_HERE-darwin | |
| - name: upload linux release asset | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./PROJECT_NAME_HERE-linux | |
| asset_name: linux | |
| asset_content_type: application/binary | |
| - name: upload darwin release asset | |
| uses: actions/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./PROJECT_NAME_HERE-darwin | |
| asset_name: darwin | |
| asset_content_type: application/binary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment