Skip to content

ci: move to ghcr.io and use GITHUB_TOKEN for registry auth (#151) #11

ci: move to ghcr.io and use GITHUB_TOKEN for registry auth (#151)

ci: move to ghcr.io and use GITHUB_TOKEN for registry auth (#151) #11

Workflow file for this run

# 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