-
Notifications
You must be signed in to change notification settings - Fork 20
92 lines (82 loc) · 2.85 KB
/
release.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
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
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: semantic-release
id: semantic
uses: ./
with:
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Dump semantic outputs
if: steps.semantic.outputs.new-release-published == 'true'
run: |
echo "Outputs:\n"
echo "$SEMANTIC_OUTPUTS"
echo "\n-----\n\nEnvironment Variables:\n"
echo "NEW_RELEASE_PUBLISHED: $NEW_RELEASE_PUBLISHED"
echo "RELEASE_VERSION: $RELEASE_VERSION"
echo "RELEASE_MAJOR: $RELEASE_MAJOR"
echo "RELEASE_MINOR: $RELEASE_MINOR"
echo "RELEASE_PATCH: $RELEASE_PATCH"
echo "RELEASE_NOTES: $RELEASE_NOTES"
echo "RELEASE_TYPE: $RELEASE_TYPE"
echo "RELEASE_CHANNEL: $RELEASE_CHANNEL"
echo "RELEASE_GIT_HEAD: $RELEASE_GIT_HEAD"
echo "RELEASE_GIT_TAG: $RELEASE_GIT_TAG"
echo "RELEASE_NAME: $RELEASE_NAME"
env:
SEMANTIC_OUTPUTS: ${{ toJson(steps.semantic-dry-run.outputs) }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker login
run: |
echo "$GCR_TOKEN" | docker login ghcr.io -u codfish --password-stdin
env:
GCR_TOKEN: ${{ secrets.GCR_TOKEN }}
# Step to create a list of tags to push to GCR always including the latest tag and optionally
# the new release tag and major release tag.
- name: Create tags list
id: tags
shell: bash
run: |
TAGS="ghcr.io/codfish/semantic-release-action:latest"
if [ "${{ steps.semantic.outputs.new-release-published }}" == "true" ]; then
TAGS="${TAGS},ghcr.io/codfish/semantic-release-action:v${{ steps.semantic.outputs.release-version }}"
TAGS="${TAGS},ghcr.io/codfish/semantic-release-action:v${{ steps.semantic.outputs.release-major }}"
fi
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
# Push docker images to GCR
# Dockerhub is auto synced with the repo, no need to explicitly deploy
- name: Build and push docker images to GCR
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ steps.tags.outputs.tags }}