From 5208f929af24ce245fb6b566d16fa23d9f79e9d9 Mon Sep 17 00:00:00 2001 From: Ben Bornholm Date: Mon, 27 Dec 2021 18:29:30 -0600 Subject: [PATCH] Upadate - 13 --- .github/workflows/tagged-releases.yml | 51 +++++++++++---------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/workflows/tagged-releases.yml b/.github/workflows/tagged-releases.yml index c89adf3c..0bf467a5 100644 --- a/.github/workflows/tagged-releases.yml +++ b/.github/workflows/tagged-releases.yml @@ -6,14 +6,28 @@ on: - 'v*' jobs: - create_release: + build: runs-on: ubuntu-20.04 + strategy: + matrix: + components: ['tls', 'admin', 'api', 'cli'] + goos: ['linux'] + goarch: ['amd64'] steps: - ######################################## Checkout code ######################################## - name: Checkout code uses: actions/checkout@v2 - - ######################################## Create release ######################################## + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - run: go version + - name: Get GO deps + run: go mod download + - name: Build osctrl-tls + run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ./bin/osctrl-${{ matrix.components }}-${{ github.ref }}-${{ matrix.goos }}-${{ matrix.goarch }}.bin ./${{ matrix.components }} + create_release: + runs-on: ubuntu-20.04 + steps: - name: Create Release uses: actions/create-release@v1 id: create_release @@ -32,31 +46,8 @@ jobs: components: ['tls', 'admin', 'api', 'cli'] goos: ['linux'] goarch: ['amd64'] - steps: - ######################################## Download artifacts and unzip ######################################## - - name: Download a single artifact - uses: actions/download-artifact@v2 - with: - name: osctrl-binaries-${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }} - needs: [create_zip_of_build_artifacts] - - name: List contents - run: ls -l - needs: [create_zip_of_build_artifacts] - - name: Unzip - run: unzip osctrl-binaries-${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}.zip - needs: [create_zip_of_build_artifacts] - - name: List contents - run: ls -l - needs: [create_zip_of_build_artifacts] - - name: Rename binary - id: rename_binary - run: mv osctrl-${{ matrix.components }}-linux-amd64.bin osctrl-${{ matrix.components }}-${{ github.ref }}-linux-amd64.bin - needs: [create_zip_of_build_artifacts] - - ######################################## Add build artifacts to release ######################################## - - name: Release + steps: + - name: Add build artifacts to release uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') with: - files: 'osctrl-*.bin' - needs: [create_zip_of_build_artifacts, rename_binary] \ No newline at end of file + files: '/bin/osctrl-*.bin'