Merge pull request #53 from bruin-data/TanayBensuYurtturk/cf-legacy-f… #55
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: Edge Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: edge-release-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Compute edge tag | |
| id: edge | |
| shell: bash | |
| run: | | |
| short_sha="$(printf '%.7s' "$GITHUB_SHA")" | |
| edge_tag="v0.0.0-edge.${GITHUB_RUN_NUMBER}.${short_sha}" | |
| echo "tag=${edge_tag}" >> "$GITHUB_OUTPUT" | |
| - name: Create local edge tag | |
| shell: bash | |
| run: git tag "${{ steps.edge.outputs.tag }}" "$GITHUB_SHA" | |
| - name: Write release notes | |
| shell: bash | |
| run: | | |
| cat > /tmp/edge-release-notes.md <<EOF | |
| ## Edge build | |
| Commit: \`${GITHUB_SHA}\` | |
| Install with: | |
| \`\`\`bash | |
| curl -LsSf https://getbruin.com/install/dac | sh -s -- --channel edge | |
| \`\`\` | |
| EOF | |
| - name: Verify telemetry key | |
| shell: bash | |
| env: | |
| TELEMETRY_KEY: ${{ secrets.TELEMETRY_KEY }} | |
| run: | | |
| if [ -z "$TELEMETRY_KEY" ]; then | |
| echo "TELEMETRY_KEY repository secret must be configured for edge releases." >&2 | |
| exit 1 | |
| fi | |
| - name: Release edge build | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: "~> v2" | |
| args: release --clean --release-notes /tmp/edge-release-notes.md | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| GORELEASER_CURRENT_TAG: ${{ steps.edge.outputs.tag }} | |
| TELEMETRY_KEY: ${{ secrets.TELEMETRY_KEY }} |