Repository navigation
111 lines (98 loc) · 4.13 KB
/
Copy pathrelease-please.yml
File metadata and controls
111 lines (98 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Release Please
on:
workflow_run:
workflows: ["Build and Push Docker Images"]
types:
- completed
branches:
- main
workflow_dispatch:
inputs:
note:
description: "Optional note for why this run was triggered manually."
required: false
type: string
permissions:
contents: write
issues: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
# Only run automatically if the image build workflow succeeded; manual runs skip this gate.
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
# Serialize release-please runs so concurrent Docker-build completions
# don't race each other and hit "tag already_exists" errors.
concurrency:
group: release-please
cancel-in-progress: false
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
backend_release_created: ${{ steps.release.outputs['apps/backend--release_created'] }}
backend_tag_name: ${{ steps.release.outputs['apps/backend--tag_name'] }}
backend_version: ${{ steps.release.outputs['apps/backend--version'] }}
backend_sha: ${{ steps.release.outputs['apps/backend--sha'] }}
web_release_created: ${{ steps.release.outputs['apps/web--release_created'] }}
web_tag_name: ${{ steps.release.outputs['apps/web--tag_name'] }}
web_version: ${{ steps.release.outputs['apps/web--version'] }}
web_sha: ${{ steps.release.outputs['apps/web--sha'] }}
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
# PAT so release PRs trigger other workflows (auto-label, add-issues-and-prs-to-fs-project-board).
# This PAT has the permissions outlined in https://github.com/googleapis/release-please-action?tab=readme-ov-file#workflow-permissions.
# Using GITHUB_TOKEN suppresses follow-on workflow runs, which would mean release-please PRs wouldn't get properly labeled and added to the project board.
token: ${{ secrets.FILOZZY_RELEASE_PLEASE_PAT }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
retag-backend:
needs: release-please
if: needs.release-please.outputs.backend_release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag backend image
run: |
SOURCE_SHA="${{ needs.release-please.outputs.backend_sha }}"
VERSION="${{ needs.release-please.outputs.backend_version }}"
REPO="ghcr.io/filozone/dealbot-backend"
echo "Retagging ${REPO}:sha-${SOURCE_SHA} → ${REPO}:v${VERSION}"
# Use docker buildx imagetools to create a new tag pointing to the same image
docker buildx imagetools create \
--tag "${REPO}:v${VERSION}" \
"${REPO}:sha-${SOURCE_SHA}"
echo "✅ Backend released: v${VERSION}"
retag-web:
needs: release-please
if: needs.release-please.outputs.web_release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag web image
run: |
SOURCE_SHA="${{ needs.release-please.outputs.web_sha }}"
VERSION="${{ needs.release-please.outputs.web_version }}"
REPO="ghcr.io/filozone/dealbot-web"
echo "Retagging ${REPO}:sha-${SOURCE_SHA} → ${REPO}:v${VERSION}"
# Use docker buildx imagetools to create a new tag pointing to the same image
docker buildx imagetools create \
--tag "${REPO}:v${VERSION}" \
"${REPO}:sha-${SOURCE_SHA}"
echo "✅ Web released: v${VERSION}"