From e366e2aba6398a8fe9172460fb7f9a237e5b4c01 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 | 102 +++++++++++++++++++++++++++++ .goreleaser/linux.yml | 1 + 2 files changed, 103 insertions(+) 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..e8fc825b --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,102 @@ +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 tests + run: env TBLS=tbls.exe make ci_windows + shell: bash + + - 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/.goreleaser/linux.yml b/.goreleaser/linux.yml index fce5cc6f..161ba87a 100644 --- a/.goreleaser/linux.yml +++ b/.goreleaser/linux.yml @@ -21,6 +21,7 @@ builds: - linux goarch: - amd64 + - arm64 archives: - id: tbls-archive