diff --git a/.github/workflows/onlytest.yml b/.github/workflows/onlytest.yml index 2c83b1a..fb2a703 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,21 @@ 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: Set up Go 1.19 + uses: actions/setup-go@v3 + with: + go-version: 1.19 + + - name: Check out code + uses: actions/checkout@v3 + + - name: Build extension + run: | + go version + make build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec47c34..e39f180 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,66 +23,31 @@ 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 }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - 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 - needs: setup-release - runs-on: ubuntu-latest - steps: - - name: Download artifact to get url to upload to release - uses: actions/download-artifact@v2 + - name: Set up Go 1.19 + uses: actions/setup-go@v3 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" + go-version: 1.19 - 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 + - name: Create new release with asset + 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 + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + files: bin/extension.zip