-
Notifications
You must be signed in to change notification settings - Fork 10
44 lines (41 loc) · 1.26 KB
/
tag.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
# SPDX-License-Identifier: MIT
name: release
on:
push:
tags:
- 'v*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v5
with:
go-version: '1.20.4'
- name: make all
run: |
make all
- name: generate changelog from git
run: |
echo "Image is available at \`ghcr.io/mercedes-benz/kosmoo/kosmoo:$(git describe --tags --exact-match)\`." > ${{ github.workflow }}-CHANGELOG.txt
git log --format=format:"* %h %s" $(git describe --tags --abbrev=0 @^)..@ >> ${{ github.workflow }}-CHANGELOG.txt
- name: push to package registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
make push
env:
PACKAGE_REPO_TOKEN: ${{ secrets.PACKAGE_REPO_TOKEN }}
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "kosmoo,LICENSE"
bodyFile: "${{ github.workflow }}-CHANGELOG.txt"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true