-
Notifications
You must be signed in to change notification settings - Fork 211
58 lines (50 loc) · 1.69 KB
/
draft_releases.yml
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
name: Draft releases
on:
push:
branches:
- main
# Prevent concurrency with other workflows in the "Release workflow group"
# See https://github.com/WordPress/openverse/issues/4505 for context
concurrency:
group: operates_on_github_releases
cancel-in-progress: false
jobs:
draft-release:
name: "Draft ${{ matrix.app }} release"
runs-on: ubuntu-latest
permissions:
# write permission is required to create a github release
contents: write
strategy:
matrix:
app:
- api
- frontend
- catalog
- ingestion_server
steps:
- uses: actions/checkout@v4
- name: Calculate tag name
id: tag
run: |
# Format example: 2023.03.22.04.56.29
# `-u` forces UTC
formatted_date="$(date -u +%Y.%m.%d.%H.%M.%S)"
{
echo "date=$formatted_date";
echo "git-tag=${{ matrix.app }}-$formatted_date";
} >> "$GITHUB_OUTPUT"
# Each time this runs, it should replace the previous drafted release matching the tag prefix set in the release drafter config
# This means there will always be a running drafted release for all apps
# Publishing the drafted release triggers the "Tag docker image and trigger deployment" workflow
- uses: release-drafter/release-drafter@v6
id: release-drafter
with:
config-name: release-drafter-${{ matrix.app }}.yml
version: ${{ steps.tag.outputs.date }}
tag: ${{ steps.tag.outputs.git-tag }}
name: ${{ steps.tag.outputs.git-tag }}
draft: true
commitish: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}