From bc859e595ff2de87c963a5cab8a9ea0011d86b64 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Sat, 14 Nov 2020 10:55:51 +0000 Subject: [PATCH] Fix build for release tags Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- .github/workflows/publish.yaml | 82 ++++------------------------------ Makefile | 5 ++- 2 files changed, 12 insertions(+), 75 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 071a8c5..375ee02 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,12 +7,10 @@ on: jobs: publish: - env: - GO111MODULE: off strategy: matrix: - go-version: [1.13.x] - os: [ubuntu-latest] + go-version: [ 1.13.x ] + os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master @@ -22,75 +20,11 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - - name: test - run: make test - - name: dist - run: make dist - - name: hashgen - run: make hashgen - - - name: Create Release - id: create_release - uses: actions/create-release@v1 + - name: Make publish + run: make publish + - name: Upload release binaries + uses: alexellis/upload-assets@0.2.2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - - name: Upload Release faasd - 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/faasd - asset_name: faasd - asset_content_type: application/binary - - name: Upload Release faasd-armhf - 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/faasd-armhf - asset_name: faasd-armhf - asset_content_type: application/binary - - name: Upload Release faasd-arm64 - 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/faasd-arm64 - asset_name: faasd-arm64 - asset_content_type: application/binary - - name: Upload Release faasd.sha256 - 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/faasd.sha256 - asset_name: faasd.sha256 - asset_content_type: text/plain - - name: Upload Release faasd-armhf.sha256 - 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/faasd-armhf.sha256 - asset_name: faasd-armhf.sha256 - asset_content_type: text/plain - - name: Upload Release faasd-arm64.sha256 - 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/faasd-arm64.sha256 - asset_name: faasd-arm64.sha256 - asset_content_type: text/plain + asset_paths: '["./bin/faasd*"]' \ No newline at end of file diff --git a/Makefile b/Makefile index 43fe198..a8c6cf8 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,10 @@ ARCH := amd64 export GO111MODULE=on .PHONY: all -all: local +all: test dist hashgen + +.PHONY: publish +all: dist hashgen local: CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o bin/faasd