-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.46 KB
/
release.yaml
File metadata and controls
54 lines (44 loc) · 1.46 KB
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
on:
push:
tags:
- 'v*'
name: Release
jobs:
release:
runs-on: ubuntu-20.04
env:
DOCKER_REPO: ghcr.io/netsoc/iamd
RELEASE_NAME: iamd
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '^1.16.5'
- name: Install crane
run: go install github.com/google/go-containerregistry/cmd/crane@v0.5.1
- id: vars
name: Generate release vars
run: |
echo "::set-output name=version::"$(echo "${{ github.ref }}" | sed -r 's|refs/tags/v(.+)|\1|')""
echo "Changelog: " > release.md
git log --pretty=format:" - %s" "$(git describe --tags --abbrev=0 ${{ github.event.ref }}^)"..${{ github.event.ref }} >> release.md
- name: Log into GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag Docker image
run: crane tag ${{ env.DOCKER_REPO }}:latest ${{ steps.vars.outputs.version }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.RELEASE_NAME }} ${{ steps.vars.outputs.version }}
body_path: release.md