This repository was archived by the owner on Jun 29, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 3.81 KB
/
Copy pathrelease.yml
File metadata and controls
98 lines (85 loc) · 3.81 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
name: Release Please
on:
push:
branches:
- main
workflow_dispatch:
# Minimize default permissions; grant elevated permissions only to the
# `release_please` job below.
permissions:
contents: write
issues: write
pull-requests: write
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
# `vars.ACTIONS_RUNNER_TYPE` is set on private repositories only.
release_please:
runs-on: ${{ vars.ACTIONS_RUNNER_TYPE || 'ubuntu-latest' }}
timeout-minutes: 5
continue-on-error: true
steps:
- name: Release Please
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7
id: release
with:
release-type: node
# From:
# https://github.com/googleapis/release-please-action?tab=readme-ov-file#creating-majorminor-tags
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
if: ${{ steps.release.outputs.release_created }}
- name: Tag Major and Minor Versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
- name: Setup QEMU
if: ${{ steps.release.outputs.release_created }}
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
- name: Setup Docker Buildx
if: ${{ steps.release.outputs.release_created }}
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Login to Docker Hub
if: ${{ steps.release.outputs.release_created }}
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Metadata
if: ${{ steps.release.outputs.release_created }}
id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Commit SHA Tag
# The Tag based on the branch (main)
# The "prod" Tag, indicating a production-ready image
# The Major, Major.Minor, and Major.Minor.Patch tags
tags: |
type=sha
type=ref,event=branch
prod
${{ steps.release.outputs.major }}
${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
- name: Build and Push
if: ${{ steps.release.outputs.release_created }}
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}