-
Notifications
You must be signed in to change notification settings - Fork 20
78 lines (70 loc) · 2.59 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
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: docker login
run: |
echo "$GCR_TOKEN" | docker login ghcr.io -u codfish --password-stdin
env:
GCR_TOKEN: ${{ secrets.GCR_TOKEN }}
# Dockerhub is auto synced with the repo, no need to explicitly deploy
- name: build and push latest docker image to GCR
run: |
docker build -t ghcr.io/codfish/semantic-release-action:latest .
docker push ghcr.io/codfish/semantic-release-action:latest
- name: push docker images for releases to GCR
if: steps.semantic.outputs.new-release-published == 'true'
run: |
docker tag ghcr.io/codfish/semantic-release-action ghcr.io/codfish/semantic-release-action:$VERSION_TAG
docker tag ghcr.io/codfish/semantic-release-action ghcr.io/codfish/semantic-release-action:$MAJOR_TAG
docker push ghcr.io/codfish/semantic-release-action:$VERSION_TAG
docker push ghcr.io/codfish/semantic-release-action:$MAJOR_TAG
env:
VERSION_TAG: v${{ steps.semantic.outputs.release-version }}
MAJOR_TAG: v${{ steps.semantic.outputs.release-major }}