Skip to content

Commit

Permalink
Merge pull request #30 from CptOfEvilMinions/initial-cicd
Browse files Browse the repository at this point in the history
Upadate - 30
  • Loading branch information
CptOfEvilMinions authored Dec 28, 2021
2 parents 748d8d2 + 340fc06 commit 4e63c09
Showing 1 changed file with 49 additions and 4 deletions.
53 changes: 49 additions & 4 deletions .github/workflows/tagged-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'v*'

jobs:
build:
build_and_test:
runs-on: ubuntu-20.04
strategy:
matrix:
Expand All @@ -28,11 +28,56 @@ jobs:
run: go mod download
######################################## Build osctrl binaries ########################################
- name: Build osctrl-tls
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o osctrl-${{ matrix.components }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin ./${{ matrix.components }}
- name: List contents
run: ls -l
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ./bin/osctrl-${{ matrix.components }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin ./${{ matrix.components }}
######################################## Upload artifacts ########################################
- name: Upload osctrl bianries
uses: actions/upload-artifact@v2
with:
name: osctrl-${{ matrix.components }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin
path: ./bin/osctrl-${{ matrix.components }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin
release:
needs: [build]
runs-on: ubuntu-20.04
strategy:
matrix:
components: ['tls', 'admin', 'api', 'cli']
goos: ['linux']
goarch: ['amd64']
steps:
######################################## Download artifacts ########################################
- name: Download osctrl bianries
uses: actions/download-artifact@v2
with:
name: osctrl-${{ matrix.components }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: osctrl-${{ matrix.components }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin


######################################## Create release ########################################
# - name: Create Release
# uses: actions/create-release@v1
# id: create_release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# draft: false
# prerelease: false
# release_name: Release ${{ github.ref }}
# tag_name: ${{ github.ref }}
# ####body_path: ./CHANGELOG.md####
######################################## Add binaries to release ########################################
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./bin/osctrl-${{ matrix.components }}-${{ github.ref }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin
# asset_name: osctrl-${{ matrix.components }}-${{ github.ref }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin
# asset_content_type: application/x-binary

0 comments on commit 4e63c09

Please sign in to comment.