Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows-artifacts: run yq --inplace to windows-artifacts.yml #4175

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 53 additions & 67 deletions .github/workflows/windows-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,94 +12,80 @@ on:
- 'docs/**'
- 'images/docs-builder/**'
- '*.adoc'

env:
IMAGE_NAME_E2E: crc-e2e
IMAGE_NAME_INTEGRATION: crc-integration

jobs:
build-installer:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['windows-2022']
go: ['1.20']
go: ['1.21']
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Set path for heat.exe and light.exe
shell: bash
run: echo "$WIX\\bin" >>$GITHUB_PATH

- name: Build Windows installer
run: make out/windows-amd64/crc-windows-installer.zip

- name: Upload windows installer artifact
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: "./out/windows-amd64/crc-windows-installer.zip"

- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Set path for heat.exe and light.exe
shell: bash
run: echo "$WIX\\bin" >>$GITHUB_PATH
- name: Build Windows installer
run: make out/windows-amd64/crc-windows-installer.zip
- name: Upload windows installer artifact
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: "./out/windows-amd64/crc-windows-installer.zip"
build-qe:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: ['darwin','windows', 'linux']
os: ['darwin', 'windows', 'linux']
arch: ['amd64', 'arm64']
exclude:
- arch: 'arm64'
os: 'windows'
- arch: 'arm64'
os: 'linux'

- arch: 'arm64'
os: 'windows'
- arch: 'arm64'
os: 'linux'
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Build qe oci images ${{matrix.os}}-${{matrix.arch}}
run: |
# e2e
CRC_E2E_IMG_VERSION=gh ARCH=${{matrix.arch}} OS=${{matrix.os}} make containerized_e2e
podman save -o ${{ env.IMAGE_NAME_E2E }}-${{matrix.os}}-${{matrix.arch}}.tar \
quay.io/crcont/${{ env.IMAGE_NAME_E2E}}:gh-${{matrix.os}}-${{matrix.arch}}
# integration
CRC_INTEGRATION_IMG_VERSION=gh ARCH=${{matrix.arch}} OS=${{matrix.os}} make containerized_integration
podman save -o ${{ env.IMAGE_NAME_INTEGRATION }}-${{matrix.os}}-${{matrix.arch}}.tar \
quay.io/crcont/${{ env.IMAGE_NAME_INTEGRATION}}:gh-${{matrix.os}}-${{matrix.arch}}

- name: Upload e2e ${{matrix.os}}-${{matrix.arch}}
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME_E2E }}-${{matrix.os}}-${{matrix.arch}}
path: ${{ env.IMAGE_NAME_E2E }}-${{matrix.os}}-${{matrix.arch}}.tar

- name: Upload integration ${{matrix.os}}-${{matrix.arch}}
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME_INTEGRATION }}-${{matrix.os}}-${{matrix.arch}}
path: ${{ env.IMAGE_NAME_INTEGRATION }}-${{matrix.os}}-${{matrix.arch}}.tar

- name: Check out repository code
uses: actions/checkout@v4
- name: Build qe oci images ${{matrix.os}}-${{matrix.arch}}
run: |
# e2e
CRC_E2E_IMG_VERSION=gh ARCH=${{matrix.arch}} OS=${{matrix.os}} make containerized_e2e
podman save -o ${{ env.IMAGE_NAME_E2E }}-${{matrix.os}}-${{matrix.arch}}.tar \
quay.io/crcont/${{ env.IMAGE_NAME_E2E}}:gh-${{matrix.os}}-${{matrix.arch}}
# integration
CRC_INTEGRATION_IMG_VERSION=gh ARCH=${{matrix.arch}} OS=${{matrix.os}} make containerized_integration
podman save -o ${{ env.IMAGE_NAME_INTEGRATION }}-${{matrix.os}}-${{matrix.arch}}.tar \
quay.io/crcont/${{ env.IMAGE_NAME_INTEGRATION}}:gh-${{matrix.os}}-${{matrix.arch}}
- name: Upload e2e ${{matrix.os}}-${{matrix.arch}}
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME_E2E }}-${{matrix.os}}-${{matrix.arch}}
path: ${{ env.IMAGE_NAME_E2E }}-${{matrix.os}}-${{matrix.arch}}.tar
- name: Upload integration ${{matrix.os}}-${{matrix.arch}}
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME_INTEGRATION }}-${{matrix.os}}-${{matrix.arch}}
path: ${{ env.IMAGE_NAME_INTEGRATION }}-${{matrix.os}}-${{matrix.arch}}.tar
save-gh-context:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Save the GH context in an artifact
env:
GH_CONTEXT: ${{ toJSON(github) }}
run: echo $GH_CONTEXT > gh_context.json

- name: Upload the GH context artifact
uses: actions/upload-artifact@v4
with:
name: gh-context
path: gh_context.json
- name: Save the GH context in an artifact
env:
GH_CONTEXT: ${{ toJSON(github) }}
run: echo $GH_CONTEXT > gh_context.json
- name: Upload the GH context artifact
uses: actions/upload-artifact@v4
with:
name: gh-context
path: gh_context.json
3 changes: 3 additions & 0 deletions update-go-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ for f in .github/workflows/*.yml; do
if [ $(yq eval '.jobs.build.strategy.matrix | has("go")' "$f") == "true" ]; then
yq eval --inplace ".jobs.build.strategy.matrix.go[0] = ${golang_base_version} | .jobs.build.strategy.matrix.go[0] style=\"single\"" "$f";
fi
if [ $(yq eval '.jobs.build-installer.strategy.matrix | has("go")' "$f") == "true" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd be able to use something like .jobs.*.strategy.matrix instead of hardcoding the name of the jobs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to create a following for this I just realized the name for the images images/*/Dockerfile will not work for build-e2e and build-integration as I use the Containerfile as name for the file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An additional question how does dependabot fit in this upgrade process?

yq eval --inplace ".jobs.build-installer.strategy.matrix.go[0] = ${golang_base_version} | .jobs.build-installer.strategy.matrix.go[0] style=\"single\"" "$f";
fi
done