-
-
Notifications
You must be signed in to change notification settings - Fork 11
48 lines (42 loc) · 1.43 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
name: release
on: [push]
jobs:
release:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: set RELEASE_VERSION ENV var
run: echo "RELEASE_VERSION=v2.10.0" >> $GITHUB_ENV
- name: ensure container version is updated to release version
run: |
image=$(yq '.runs.image' action.yml)
echo "Image: $image"
echo "Release version: ${{ env.RELEASE_VERSION }}"
[[ "$image" == *"${{ env.RELEASE_VERSION }}" ]]
- name: update the major version tag
id: majorver
uses: actions/[email protected]
with:
source-tag: ${{ env.RELEASE_VERSION }}
- name: login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v5
with:
push: true
build-args: |
VERSION=${{ env.RELEASE_VERSION }}
tags: |
ghcr.io/vladopajic/go-test-coverage:${{ env.RELEASE_VERSION }}
ghcr.io/vladopajic/go-test-coverage:${{ steps.majorver.outputs.major-tag }}
ghcr.io/vladopajic/go-test-coverage:latest