From 53f84cc1bb0b711ddf65bb7b3833e1bffabc6df8 Mon Sep 17 00:00:00 2001 From: Edouard CLAUDE Date: Thu, 15 Jun 2023 08:53:41 +0400 Subject: [PATCH] workflow --- .github/workflows/release.yaml | 43 ++++++++++++---------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 28364f5..437edaa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,44 +1,31 @@ -name: Release +name: Release Go project on: push: - branches: [master] + tags: + - "*" jobs: - build-and-release: - name: Build and release + build: + name: GoReleaser build runs-on: ubuntu-latest + steps: - - name: Check out code + - name: Check out code into the Go module directory uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: Set up Go + - name: Set up Go 1.14 uses: actions/setup-go@v2 with: go-version: 1.20.3 + id: go - - name: Get dependencies - run: go mod download - - - name: Build - run: go build -o react-go-ssr main.go - - - name: Create Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@master with: - tag_name: ${{ github.sha }} - release_name: Release ${{ github.sha }} - draft: false - prerelease: false - - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 + version: latest + args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./react-go-ssr - asset_name: react-go-ssr - asset_content_type: application/octet-stream