ci: fix release pipeline #7
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
# SPDX-FileCopyrightText: 2023 Siemens AG | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
# Author: Michael Adler <[email protected]> | |
--- | |
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
jobs: | |
wfx: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
fetch-depth: 0 | |
- name: Disable git security features | |
run: git config --global safe.directory '*' | |
- name: Export Golang version as env variable | |
run: | | |
GO_VERSION=$(grep -E '^go\s*[0-9]+\.[0-9]+\.[0-9]+$' go.mod | sed 's/^go\s*//') | |
# You can make an environment variable available to any subsequent | |
# steps in a workflow job by defining or updating the environment | |
# variable and writing this to the GITHUB_ENV environment file. | |
echo "GO_VERSION=$GO_VERSION" | tee -a "$GITHUB_ENV" | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "${{ env.GO_VERSION }}" | |
- run: sudo .ci/setup-build.sh | |
# goreleaser requires an absolute path to the compiler | |
- run: sudo install -m0755 .ci/zcc /usr/local/bin/zcc | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.PACKAGE_DEPLOY_USER }} | |
password: ${{ secrets.PACKAGE_DEPLOY_TOKEN }} | |
- name: Run GoReleaser | |
run: goreleaser release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.PACKAGE_DEPLOY_TOKEN }} | |
CC: /usr/local/bin/zcc |