forked from project-stacker/stacker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): add a "build-id" input var to ci builds
Currently, the github workflows dependencies are chained as follows: build.yaml -> ci.yaml release.yaml -> ci.yaml convert.yaml -> ci.yaml build.yaml and release.yaml are inline builds but operate on different build triggers. convert.yaml is timer-based and works offline. Signed-off-by: Ramkumar Chinchani <[email protected]>
- Loading branch information
Showing
4 changed files
with
25 additions
and
18 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ jobs: | |
["1.20.x"] | ||
privilege-level: >- | ||
["unpriv", "priv"] | ||
build-id: >- | ||
["${{ github.ref }}"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,28 +9,17 @@ env: | |
REGISTRY_URL: localhost:5000 | ||
|
||
jobs: | ||
ci: | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
# note >-, args needs to be strings to be used as inputs | ||
# for the reusable build.yaml workflow | ||
go-version: >- | ||
["1.20.x"] | ||
privilege-level: >- | ||
["priv"] | ||
convert: | ||
name: "convert" | ||
runs-on: ubuntu-20.04 | ||
# needs ci for the cached stacker binary | ||
needs: ci | ||
steps: | ||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
- uses: actions/cache@v3 | ||
id: restore-build | ||
with: | ||
path: stacker | ||
key: ${{ steps.short-sha.outputs.sha }} | ||
key: ${{ github.ref }} | ||
- name: zot registry | ||
env: | ||
ZOT_HOST: localhost | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,28 +6,39 @@ on: | |
- published | ||
|
||
jobs: | ||
build-id: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build-id: ${{steps.build-id.outputs.build-id}} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
- id: build-id | ||
run: echo "build-id=${{ github.event.release.tag_name }}-${{ steps.short-sha.outputs.sha }}" >> "$GITHUB_OUTPUT" | ||
ci: | ||
uses: ./.github/workflows/build.yaml | ||
needs: build-id | ||
with: | ||
# note >-, args needs to be strings to be used as inputs | ||
# for the reusable build.yaml workflow | ||
go-version: >- | ||
["1.20.x"] | ||
privilege-level: >- | ||
["priv"] | ||
build-id: >- | ||
["${{needs.build-id.outputs.build-id}}"] | ||
release: | ||
name: "Tagged Release" | ||
runs-on: ubuntu-20.04 | ||
# needs ci for the cached stacker binary | ||
needs: ci | ||
needs: [build-id, ci] | ||
steps: | ||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
- uses: actions/cache@v3 | ||
id: restore-build | ||
with: | ||
path: stacker | ||
key: ${{ steps.short-sha.outputs.sha }} | ||
key: ${{needs.build-id.outputs.build-id}} | ||
- if: github.event_name == 'release' && github.event.action == 'published' | ||
name: Publish artifacts on releases | ||
uses: svenstaro/upload-release-action@v2 | ||
|