From d34e1bf49fee5b06c809a17b4580400dac47ffdc Mon Sep 17 00:00:00 2001 From: k1LoW Date: Mon, 2 Oct 2023 21:05:02 +0900 Subject: [PATCH] Add release test --- .github/workflows/release-test.yml | 98 ++++++++++++++++++++++++++++++ .github/workflows/tagpr.yml | 28 ++++----- Makefile | 2 +- 3 files changed, 113 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/release-test.yml diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 00000000..4cfcfd5b --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,98 @@ +name: release test + +on: + push: + branches: + - main + pull_request: + paths: + - .goreleaser/*.yml + +jobs: + darwin-release-test: + runs-on: macos-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Check out source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Setup + run: | + brew install goreleaser + brew install sqlite3 + + - name: Release (dry-run) + run: | + goreleaser release --config .goreleaser/darwin.yml --clean --snapshot --skip=publish + + linux-release-test: + runs-on: ubuntu-latest + steps: + - name: Install packages + run: | + sudo apt-get update + sudo apt-get install sqlite3 + + - name: Install aws-cli + uses: isbang/setup-awscli@v0.1.0 + + - name: Check out source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go on Ubuntu + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Run GoReleaser (dry-run) + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: --config .goreleaser/linux.yml --clean --snapshot --skip=publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + windows-release-test: + runs-on: windows-2019 + steps: + - name: Use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - name: Install packages + run: | + choco install sqlite + + - name: Install aws-cli + uses: isbang/setup-awscli@v0.1.0 + + - name: Check out source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go on Windows + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + + - name: Run GoReleaser (dry-run) + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: --config .goreleaser/windows.yml --clean --snapshot --skip=publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tagpr.yml b/.github/workflows/tagpr.yml index 85fcdc6d..9aaf25e1 100644 --- a/.github/workflows/tagpr.yml +++ b/.github/workflows/tagpr.yml @@ -13,10 +13,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Check out source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: go.mod @@ -32,12 +32,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Check out source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: go.mod @@ -64,12 +64,12 @@ jobs: uses: isbang/setup-awscli@v0.1.0 - name: Check out source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go on Ubuntu - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: go.mod @@ -79,11 +79,11 @@ jobs: sleep 20s - name: Run GoReleaser (dry-run) - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser version: latest - args: --config .goreleaser/linux.yml --rm-dist --snapshot --skip-publish + args: --config .goreleaser/linux.yml --clean --snapshot --skip=publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -93,11 +93,11 @@ jobs: git restore . - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser version: latest - args: --config .goreleaser/linux.yml --rm-dist + args: --config .goreleaser/linux.yml --rm-clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -119,12 +119,12 @@ jobs: uses: isbang/setup-awscli@v0.1.0 - name: Check out source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go on Windows - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: go.mod @@ -133,11 +133,11 @@ jobs: shell: bash - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser version: latest - args: --config .goreleaser/windows.yml --rm-dist + args: --config .goreleaser/windows.yml --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 431d55ce..4b0a44d1 100644 --- a/Makefile +++ b/Makefile @@ -181,6 +181,6 @@ prerelease_for_tagpr: depsdev git add CHANGELOG.md CREDITS go.mod go.sum release_darwin: - goreleaser --config .goreleaser/darwin.yml --rm-dist + goreleaser --config .goreleaser/darwin.yml --clean .PHONY: default test