2021-04-30 22:23:51 +00:00
|
|
|
name: Create Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: 'version to release, e.g. v1.5.13'
|
|
|
|
required: true
|
|
|
|
default: 'v0.1.0'
|
|
|
|
|
|
|
|
env:
|
|
|
|
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
|
2022-02-02 18:48:57 +00:00
|
|
|
GO_VERSION: '1.17'
|
2021-04-30 22:23:51 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Create Release
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-19 20:07:50 +00:00
|
|
|
|
2021-04-30 22:23:51 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-07 08:06:46 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-04-30 22:23:51 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.event.inputs.version }}
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
|
|
|
|
- name: Build Changelog
|
|
|
|
id: build_changelog
|
2021-06-28 08:04:49 +00:00
|
|
|
uses: mikepenz/release-changelog-builder-action@v2
|
2021-04-30 22:23:51 +00:00
|
|
|
with:
|
|
|
|
configuration: "changelog.json"
|
|
|
|
toTag: ${{ github.event.inputs.version }}
|
|
|
|
commitMode: true
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: create changelog file
|
|
|
|
env:
|
|
|
|
VERSION: ${{ github.event.inputs.version }}
|
|
|
|
CHANGELOG: ${{ steps.build_changelog.outputs.changelog }}
|
|
|
|
run: |
|
|
|
|
echo "Image: \`ghcr.io/${GITHUB_REPOSITORY}:${VERSION}\`" >> .changelog
|
|
|
|
echo "${CHANGELOG}" >> .changelog
|
|
|
|
|
|
|
|
- name: Update Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.event.inputs.version }}
|
|
|
|
body_path: .changelog
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
|
2022-02-02 18:48:23 +00:00
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
|
2022-02-01 18:59:14 +00:00
|
|
|
- name: Update Docs
|
|
|
|
run: make docs.publish DOCS_VERSION=${{ github.event.inputs.version }} DOCS_ALIAS=latest
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
|
2021-04-30 22:23:51 +00:00
|
|
|
promote:
|
|
|
|
name: Promote Container Image
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-19 20:07:50 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
|
2021-04-30 22:23:51 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-07 08:06:46 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-04-30 22:23:51 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Login to Docker
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
if: env.GHCR_USERNAME != ''
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ secrets.GHCR_USERNAME }}
|
|
|
|
password: ${{ secrets.GHCR_TOKEN }}
|
|
|
|
|
|
|
|
- name: Promote Container Image
|
|
|
|
if: env.GHCR_USERNAME != ''
|
|
|
|
run: make docker.promote
|
|
|
|
env:
|
|
|
|
RELEASE_TAG: ${{ github.event.inputs.version }}
|
2021-07-29 06:57:26 +00:00
|
|
|
SOURCE_TAG: main
|
2022-03-19 20:07:50 +00:00
|
|
|
|
|
|
|
- name: Set up crane
|
|
|
|
if: env.GHCR_USERNAME != ''
|
|
|
|
run: go install github.com/google/go-containerregistry/cmd/crane@v0.8.0
|
|
|
|
|
|
|
|
- name: Sign Container Image
|
|
|
|
if: env.GHCR_USERNAME != ''
|
|
|
|
run: make docker.sign
|
|
|
|
env:
|
|
|
|
RELEASE_TAG: ${{ github.event.inputs.version }}
|
|
|
|
SOURCE_TAG: main
|