Skip to content

Commit

Permalink
Add more platforms to GitHub Actions (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmenezes authored Jul 29, 2020
1 parent 178318c commit 2a0f4cf
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:

tag:
name: Tag
name: Create Release
runs-on: ubuntu-latest
steps:

Expand All @@ -23,15 +23,6 @@ jobs:
- name: Generate list of changes
run: scripts/generate_release_notes.sh > .release.md

- name: Generate build files
uses: thatisuday/go-cross-build@v1
with:
platforms: 'linux/amd64, darwin/amd64, windows/amd64'
name: 'codeowners'
compress: 'true'
dest: 'dist'
package: 'cmd/codeowners'

- name: Create Github Release
uses: actions/create-release@v1
id: create-release
Expand All @@ -42,32 +33,40 @@ jobs:
release_name: ${{ github.ref }}
body_path: ./.release.md

- name: Upload Release Asset (darwin-amd64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./dist/codeowners-darwin-amd64.tar.gz
asset_name: codeowners-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: Export Upload URL
run: echo "::set-output name=upload_url::${{ steps.create-release.outputs.upload_url }}"

- name: Upload Release Asset (linux-amd64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload:
name: Upload Release Artefacts
needs: tag
strategy:
matrix:
os:
- linux
- darwin
- windows
arch:
- amd64
- 386
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Generate build files
uses: thatisuday/go-cross-build@v1
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./dist/codeowners-linux-amd64.tar.gz
asset_name: codeowners-linux-amd64.tar.gz
asset_content_type: application/gzip
platforms: ${{ matrix.os }}/${{ matrix.arch }}
name: 'codeowners'
compress: 'true'
dest: 'dist'
package: 'cmd/codeowners'

- name: Upload Release Asset (windows-amd64)
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./dist/codeowners-windows-amd64.tar.gz
asset_name: codeowners-windows-amd64.tar.gz
upload_url: ${{ needs.tag.outputs.upload_url }}
asset_path: ./dist/codeowners-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_name: codeowners-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip

0 comments on commit 2a0f4cf

Please sign in to comment.