docs(quick-1): Fix 6 TS generator bugs: enum query params, repeated f… #15
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to release' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| packages: write | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.21' | |
| cache: true | |
| - name: Setup Protoc | |
| uses: arduino/setup-protoc@v3 | |
| with: | |
| version: '25.1' | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Buf | |
| uses: bufbuild/buf-setup-action@v1 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | |
| - name: Run tests | |
| run: ./scripts/run_tests.sh | |
| - name: Import GPG key | |
| if: env.GPG_PRIVATE_KEY != '' | |
| env: | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| run: | | |
| echo "$GPG_PRIVATE_KEY" | gpg --dearmor --output /tmp/keyring.gpg | |
| echo "$GPG_PRIVATE_KEY" | gpg --batch --import | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} | |
| - name: Upload release artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: release-artifacts | |
| path: dist/ | |
| docker: | |
| name: Docker Images | |
| runs-on: ubuntu-latest | |
| needs: release | |
| strategy: | |
| matrix: | |
| plugin: | |
| - name: go-http | |
| dockerfile: Dockerfile.http | |
| - name: openapiv3 | |
| dockerfile: Dockerfile.openapi | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ secrets.DOCKER_USERNAME }}/protoc-gen-${{ matrix.plugin.name }} | |
| ghcr.io/${{ github.repository_owner }}/protoc-gen-${{ matrix.plugin.name }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/${{ matrix.plugin.dockerfile }} | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| announce: | |
| name: Announce Release | |
| runs-on: ubuntu-latest | |
| needs: [release, docker] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Get release info | |
| id: release | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| echo "version=${TAG#v}" >> $GITHUB_OUTPUT | |
| - name: Create announcement issue | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const tag = '${{ steps.release.outputs.tag }}'; | |
| const version = '${{ steps.release.outputs.version }}'; | |
| const { data: release } = await github.rest.repos.getReleaseByTag({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag: tag | |
| }); | |
| const issueBody = `## 🎉 sebuf ${tag} has been released! | |
| ### What's New | |
| ${release.body} | |
| ### Installation | |
| #### Using Go | |
| \`\`\`bash | |
| go install github.com/SebastienMelki/sebuf/cmd/protoc-gen-go-http@${tag} | |
| go install github.com/SebastienMelki/sebuf/cmd/protoc-gen-openapiv3@${tag} | |
| \`\`\` | |
| #### Using Docker | |
| \`\`\`bash | |
| docker pull ghcr.io/sebastienmelki/protoc-gen-go-http:${version} | |
| docker pull ghcr.io/sebastienmelki/protoc-gen-openapiv3:${version} | |
| \`\`\` | |
| #### Download Binaries | |
| Download pre-built binaries from the [release page](${release.html_url}). | |
| ### Documentation | |
| - [Getting Started](https://github.com/SebastienMelki/sebuf#quickstart) | |
| - [API Documentation](https://pkg.go.dev/github.com/SebastienMelki/sebuf) | |
| - [Examples](https://github.com/SebastienMelki/sebuf/tree/main/examples) | |
| --- | |
| _This is an automated release announcement._`; | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: `🚀 Release ${tag}`, | |
| body: issueBody, | |
| labels: ['release', 'announcement'] | |
| }); |