-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (93 loc) · 2.92 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
docker:
name: docker-${{ matrix.app }}
strategy:
fail-fast: false
matrix:
app: ['api', 'www']
concurrency:
group: 'docker-${{ matrix.app }}'
cancel-in-progress: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/$GITHUB_REPOSITORY
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
file: ./apps/${{ matrix.app }}/Dockerfile
platforms: linux/amd64, linux/arm64, linux/arm/v7
provenance: true
sbom: true
create-github-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get tag name
id: tag
run: echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/}
- name: Create GitHub Release
uses: taiki-e/create-gh-release-action@v1
with:
title: Release ${{ steps.tag.outputs.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
bump-version:
runs-on: ubuntu-latest
concurrency:
group: 'bump-version'
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Format version
id: formatVersion
run: |
echo "buildVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}" >> "$GITHUB_OUTPUT"
- name: Bump version
run: |
sed -i "/\"version\":/c\ \"version\": \"${{ steps.formatVersion.outputs.buildVersion }}\"," package.json
- name: Commit version bump
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'build: bump version to ${{ steps.formatVersion.outputs.buildVersion }} [skip ci]'
commit_options: '-a'
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>