From 5161819d7ae7e2d475fe94bc087f360267cf7d50 Mon Sep 17 00:00:00 2001 From: michimani Date: Mon, 5 Dec 2022 21:42:45 +0900 Subject: [PATCH 1/4] feature: use action-gh-release #6 --- .github/workflows/release.yml | 39 ++++++----------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec47c34..819a862 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,50 +39,23 @@ jobs: draft: false prerelease: false - - name: Get url to upload to release from output - env: - url: ${{ steps.create_release.outputs.upload_url }} - run: | - mkdir artifact - echo $url > artifact/url.txt - - name: Upload artifact to share url with other jobs - uses: actions/upload-artifact@v1 - with: - name: artifact - path: artifact/url.txt - - release-code: - name: Release Source Code + create-release: + name: Create new release needs: setup-release runs-on: ubuntu-latest steps: - - name: Download artifact to get url to upload to release - uses: actions/download-artifact@v2 - with: - name: artifact - - - name: Get url to upload to release from artifact - id: get_url - run: | - pwd - ls -al - url=$(cat url.txt) - echo "##[set-output name=upload_url;]$url" - - name: Check out code into the Go module directory uses: actions/checkout@v3 - - name: Build extension and zip + - name: Build extension and zip it run: | make build cd bin && zip -r extension.zip extensions/ - name: Upload release asset - uses: actions/upload-release-asset@v1.0.2 + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.get_url.outputs.upload_url }} - asset_path: bin/extension.zip - asset_name: extension.zip - asset_content_type: application/zip + files: bin/extension.zip + name: extension.zip From 826775573314d83abbcce858029266cd077a98b2 Mon Sep 17 00:00:00 2001 From: michimani Date: Mon, 5 Dec 2022 21:49:28 +0900 Subject: [PATCH 2/4] add: build test #6 --- .github/workflows/onlytest.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/onlytest.yml b/.github/workflows/onlytest.yml index 2c83b1a..bbe1f7f 100644 --- a/.github/workflows/onlytest.yml +++ b/.github/workflows/onlytest.yml @@ -21,7 +21,7 @@ jobs: go-version: 1.19 - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get dependencies run: go install @@ -30,4 +30,14 @@ jobs: run: go test -race -coverprofile="coverage.txt" -covermode=atomic github.com/michimani/invocation-history-extension/... -shuffle=on - name: Upload code coverage to Codecov - uses: codecov/codecov-action@v3 \ No newline at end of file + uses: codecov/codecov-action@v3 + + build-test: + name: Build test + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Build extension + run: make build From a419c8fd9696e237b3479fd63d10dd9d98709a69 Mon Sep 17 00:00:00 2001 From: michimani Date: Mon, 5 Dec 2022 21:52:04 +0900 Subject: [PATCH 3/4] add: echo go version #6 --- .github/workflows/onlytest.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/onlytest.yml b/.github/workflows/onlytest.yml index bbe1f7f..7bda6e9 100644 --- a/.github/workflows/onlytest.yml +++ b/.github/workflows/onlytest.yml @@ -40,4 +40,6 @@ jobs: uses: actions/checkout@v3 - name: Build extension - run: make build + run: | + go version + make build From a2260aa221c8418e14b543c54a26e2f3976f410c Mon Sep 17 00:00:00 2001 From: michimani Date: Mon, 5 Dec 2022 21:56:17 +0900 Subject: [PATCH 4/4] fix: use go 1.19 to build extension #6 --- .github/workflows/onlytest.yml | 5 +++++ .github/workflows/release.yml | 28 ++++++++++------------------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/onlytest.yml b/.github/workflows/onlytest.yml index 7bda6e9..fb2a703 100644 --- a/.github/workflows/onlytest.yml +++ b/.github/workflows/onlytest.yml @@ -36,6 +36,11 @@ jobs: name: Build test runs-on: ubuntu-latest steps: + - name: Set up Go 1.19 + uses: actions/setup-go@v3 + with: + go-version: 1.19 + - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 819a862..e39f180 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,27 +23,16 @@ jobs: - name: Test code run: go test github.com/michimani/aws-lambda-api-go/... -shuffle=on - setup-release: - name: Setup release + create-release: + name: Build extension needs: test runs-on: ubuntu-latest steps: - - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Go 1.19 + uses: actions/setup-go@v3 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false + go-version: 1.19 - create-release: - name: Create new release - needs: setup-release - runs-on: ubuntu-latest - steps: - name: Check out code into the Go module directory uses: actions/checkout@v3 @@ -52,10 +41,13 @@ jobs: make build cd bin && zip -r extension.zip extensions/ - - name: Upload release asset + - name: Create new release with asset uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false files: bin/extension.zip - name: extension.zip