Skip to content

Update actions workflows and dependencies. #7

Update actions workflows and dependencies.

Update actions workflows and dependencies. #7

Workflow file for this run

---
name: Docker Build Action
on:
pull_request:
branches:
- master
release:
types:
- published
push:
branches:
- master
# env:
# GCS_BUCKET: images.metal-pod.io
jobs:
draft:
uses: metal-stack/actions-common/.github/workflows/release-drafter.yaml@v1
spell-check:
uses: metal-stack/actions-common/.github/workflows/spell-check.yaml@v1
go-test:
uses: metal-stack/actions-common/.github/workflows/go-build.yaml@v1
with:
build: false
test-command: |
make test lint-structs
go-build:
strategy:
matrix:
os:
- linux
- windows
- darwin
arch:
- amd64
- arm64
exclude:
- os: linux
arch: arm64
- os: windows
arch: arm64
uses: metal-stack/actions-common/.github/workflows/go-build.yaml@optional-docker-push
secrets: inherit
with:
test: false
lint: false
push: ${{ matrix.os == 'linux' && matrix.arch == 'amd64' }}
build-command: make build GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }}
artifact-files: |
bin/
release-assets:
uses: metal-stack/actions-common/.github/workflows/release-assets.yaml@v1
needs: go-build
with:
artifact-ids: ${{ needs.go-build.outputs.go-build-artifacts }}
release-assets-test:
runs-on: ubuntu-latest
needs: go-build
steps:
- uses: actions/download-artifact@v8
with:
merge-multiple: true
- run: |
ls
# FIXME:
# [ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "TARGET_BINARY_LOCATION=pull-requests/$(echo $GITHUB_REF | awk -F / '{print $3}')-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
# [ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "TARGET_BINARY_LOCATION=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
# [ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "TARGET_BINARY_LOCATION=latest" >> $GITHUB_ENV || true
# - uses: google-github-actions/auth@v2
# with:
# credentials_json: '${{ secrets.GCP_SA_KEY }}'
# - name: Set up Cloud SDK
# uses: google-github-actions/setup-gcloud@v2
# - name: Prepare upload
# run: |
# mkdir -p metalctl/${TARGET_BINARY_LOCATION}
# sudo chown -R $(id -u):$(id -g) bin
# cp bin/* metalctl/${TARGET_BINARY_LOCATION}/
# - name: Upload image tarballs to GCS
# run: gsutil -m cp -r -p metalctl gs://$GCS_BUCKET
# - name: Upload Release Asset
# uses: softprops/action-gh-release@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# files: |
# bin/metalctl-*
# bin/sbom-*.json
# if: ${{ github.event_name == 'release' }}