diff --git a/.github/workflows/on-release.yaml b/.github/workflows/on-release.yaml index 0f5f70b25..b79dcabef 100644 --- a/.github/workflows/on-release.yaml +++ b/.github/workflows/on-release.yaml @@ -14,40 +14,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '20' - - uses: actions/setup-go@v5 with: go-version: '1.22' - - name: Validate Tag - run: | - node -e "if (!/^v\d+\.\d+\.\d+$/.test('${{ github.ref_name }}')) { console.error('Invalid version provided');process.exit(1);}" - - - name: Validate VERSION - run: | - version=$(cat cmd/thor/VERSION) - tag="${{ github.ref_name }}" - tag="${tag#v}" # Remove the "v" prefix from the tag - if [ "$tag" != "$version" ]; then - echo "VERSION file does not match tag" - exit 1 - fi - - - name: Validate Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # This step validates that the tag is an official release - run: | - prerelease=$(gh release view ${{ github.ref_name }} --json isPrerelease | jq -r '.isPrerelease') - if [ "$prerelease" != "false" ]; then - echo "Tag is not an official release" - exit 1 - fi - - name: Publish Binaries uses: goreleaser/goreleaser-action@v6 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 2efb1e59a..44a04b138 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -18,8 +18,9 @@ builds: - amd64 - arm64 id: thor + hooks: + pre: make thor binary: ./bin/thor - command: make thor - env: - CGO_ENABLED=0 goos: @@ -31,7 +32,8 @@ builds: - arm64 id: disco binary: ./bin/disco - command: make disco + hooks: + pre: make disco release: github: