build: Respect env vars in release-manifests step #18
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*-d2iq.* | |
# Because variables are not exported, they are not visible by child processes, e.g. make | |
env: | |
registry: ghcr.io | |
registry_username: ${{ github.actor }} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
# The repository follows the naming convention of other Cluster API providers. | |
repository: mesosphere/cluster-api-vcd-controller | |
version: ${{ github.ref_name }} | |
jobs: | |
release: | |
name: Release | |
runs-on: | |
# For a list of pre-installed software, see https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md | |
- ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: go.mod | |
cache: true # cache go action in github actions cache store. | |
- name: Login to container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.registry }} | |
username: ${{ env.registry_username }} | |
password: ${{ env.registry_password }} | |
- name: Build multi-arch container image, and push to container registry | |
# Note: We set make variables using positional arguments (to the right of the make command), not environment | |
# variables (to the left of the make command). While make converts environment variables to make variables, the | |
# conversion is not straightforward. For example, conditional assignments are not overriden by environment | |
# variables. | |
run: | | |
make push-capvcd-image \ | |
--makefile d2iq.Makefile \ | |
REGISTRY=${{ env.registry }} \ | |
CAPVCD_IMG=${{ env.repository }} \ | |
VERSION=${{ env.version }} | |
- name: Create (draft) GitHub release | |
run: | | |
gh release create ${{ env.version }} \ | |
--title ${{ env.version }} \ | |
--draft | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate release artifacts, and attach them to the GitHub release | |
# Because steps do not share data, the artifacts must be generated and | |
# uploaded in one step. | |
# | |
# Also see note on make variables, above. | |
run: | | |
make release-manifests \ | |
--makefile d2iq.Makefile \ | |
REGISTRY=${{ env.registry }} \ | |
CAPVCD_IMG=${{ env.repository }} \ | |
VERSION=${{ env.version }} | |
gh release upload \ | |
--clobber \ | |
${{ env.version }} \ | |
metadata.yaml \ | |
templates/infrastructure-components.yaml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |