Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

chore: add usage of global output error variable within helmchart str… #19

chore: add usage of global output error variable within helmchart str…

chore: add usage of global output error variable within helmchart str… #19

Workflow file for this run

# #############################################################################
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
# #############################################################################
name: Create GitHub Release
on:
push:
tags:
- "v*.*.*"
env:
APP_NAME: "tractusx-quality-checks"
jobs:
release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Gather version facts
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
major=${version%%.*}
major_minor=${version%.*}
echo "tag=${tag}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "major=${major}" >> $GITHUB_OUTPUT
echo "major_minor=${major_minor}" >> $GITHUB_OUTPUT
- name: Create GitHub release
id: create_release
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yaml
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Force update major tag
run: |
git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f
git push origin refs/tags/v${{ steps.version.outputs.major }} -f
git tag v${{ steps.version.outputs.major_minor }} ${{ steps.version.outputs.tag }} -f
git push origin refs/tags/v${{ steps.version.outputs.major_minor }} -f
build:
runs-on: ubuntu-latest
needs: release
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64]
include:
- goos: darwin
goarch: arm64
- goos: windows
goarch: '386'
- goos: linux
goarch: '386'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
- name: Build binary
run: env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ github.workspace }}/bin/${{ env.APP_NAME }}-${{ needs.release.outputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}
working-directory: ${{ github.workspace }}
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/bin/${{ env.APP_NAME }}-${{ needs.release.outputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}
asset_name: ${{ env.APP_NAME }}-${{ needs.release.outputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}
asset_content_type: application/octet-stream