feat: go v1.23.1 (#80) #39
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- v* | |
env: | |
GO111MODULE: on | |
jobs: | |
release-base: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- run: git fetch --prune --unshallow | |
- name: Setup env | |
uses: c-py/action-dotenv-to-setenv@v3 | |
with: | |
env-file: .env | |
- name: Define and set tags | |
shell: bash | |
id: meta | |
run: | | |
cross_base_tags="$(./scripts/image-tags.sh cross-base)" | |
echo 'cross_base_tags<<EOF' >> $GITHUB_OUTPUT | |
echo "$cross_base_tags" >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Install cosign | |
uses: sigstore/cosign-installer@main | |
- name: Build and push base images | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
file: Dockerfile.base | |
tags: ${{ steps.meta.outputs.cross_base_tags }} | |
build-args: | | |
GO_VERSION=${{env.GO_VERSION}} | |
TINI_VERSION=${{env.TINI_VERSION}} | |
COSIGN_VERSION=${{env.COSIGN_VERSION}} | |
COSIGN_SHA256=${{env.COSIGN_SHA256}} | |
DEBIAN_FRONTEND=${{env.DEBIAN_FRONTEND}} | |
TOOLCHAINS_VERSION=${{env.TOOLCHAINS_VERSION}} | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- release-base | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- run: git fetch --prune --unshallow | |
- name: Setup env | |
uses: c-py/action-dotenv-to-setenv@v3 | |
with: | |
env-file: .env | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: "${{ env.GO_VERSION }}" | |
- name: get version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Install git-chglog | |
run: go install github.com/git-chglog/git-chglog/cmd/git-chglog@${{ env.GIT_CHGLOG_VERSION }} | |
- name: Generate changelog | |
run: make gen-changelog | |
- uses: cb80/delrel@latest | |
with: | |
tag: v${{ env.RELEASE_TAG}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: changelog.md | |
# - name: Sign images | |
# if: (${{ steps.branch-name.outputs.is_tag }} == true) | |
# run: | | |
# while IFS=$'\n' read -r line; do | |
# base_name=$(echo "$line" | cut -d ":" -f 1) | |
# docker pull $line | |
# | |
# id=$(docker image inspect "$line" --format='{{.Id}}') | |
# | |
# cosign sign --upload=${{ steps.branch-name.outputs.is_tag }} --key env://COSIGN_PRIVATE_KEY --recursive $base_name@$id | |
# done <<< "${{ steps.meta.outputs.cross_base_tags }}" | |
# | |
# while IFS=$'\n' read -r line; do | |
# base_name=$(echo "$line" | cut -d ":" -f 1) | |
# docker pull $line | |
# | |
# id=$(docker image inspect "$line" --format='{{.Id}}') | |
# | |
# cosign sign --upload=${{ steps.branch-name.outputs.is_tag }} --key env://COSIGN_PRIVATE_KEY --recursive $base_name@$id | |
# done <<< "${{ steps.meta.outputs.cross_tags }}" | |
# env: | |
# COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}} | |
# COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}} | |
notify-goreleaser-bump: | |
runs-on: ubuntu-latest | |
needs: | |
- release-base | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- run: git fetch --prune --unshallow | |
- name: get version | |
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: notify goreleaser-cross with new release | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: goreleaser | |
inputs: '{ "tag" : "${{ env.RELEASE_TAG }}" }' | |
notify-goreleaser-pro-bump: | |
runs-on: ubuntu-latest | |
needs: | |
- release-base | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- run: git fetch --prune --unshallow | |
- name: get version | |
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: notify goreleaser-cross-pro with new release | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: goreleaser-pro | |
inputs: '{ "tag" : "${{ env.RELEASE_TAG }}" }' |