Skip to content

Commit

Permalink
Automated Github releases (#14)
Browse files Browse the repository at this point in the history
setup basic automated Github Releases for linux,macos,windows binaries
  • Loading branch information
oboukili authored May 16, 2020
1 parent d6689b2 commit 4c8d73a
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 5 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: Release

on:
push:
tags: ["v*"]

jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- 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

assets:
name: Assets
needs: release
strategy:
fail-fast: false
matrix:
arch: [amd64]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
goos: linux
- os: macos-latest
goos: darwin
- os: windows-latest
goos: windows
runs-on: ${{ matrix.os }}
env:
asset: terraform-provider-argocd_${{ github.ref }}_${{ matrix.goos }}_${{ matrix.arch }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Restore Go cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build ${{ matrix.goos }}-${{ matrix.arch }}
env:
GOLDFLAGS: "-s -w"
GOARCH: ${{ matrix.arch }}
GOOS: ${{ matrix.goos }}
run: go build -o ${{ env.asset }}

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./${{ env.asset }}
asset_name: ${{ env.asset }}
asset_content_type: application/octet-stream
13 changes: 8 additions & 5 deletions .github/workflows/acceptance.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
---
name: Tests

on:
push:
branches: ["master"]
branches: [master]
pull_request:
branches: ["master"]
branches: [master]

jobs:
acceptance_tests:
name: Acceptance Tests
runs-on: [ubuntu-latest]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
argocd_version: ["v1.5.4", "v1.4.3"]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.14

id: go
- name: Restore Go cache
uses: actions/cache@v1
with:
Expand Down

0 comments on commit 4c8d73a

Please sign in to comment.