-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ on: | |
|
||
jobs: | ||
get-releases-affected: | ||
runs-on: ubuntu-22.04 | ||
name: Get releases affected | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
releases_affected: ${{ steps.get-releases-affected.outputs.RELEASES_AFFECTED_LIST }} | ||
releases_affected: ${{ steps.get-releases-affected.outputs.releases_affected_json }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -29,23 +29,35 @@ jobs: | |
|
||
- name: Get releases affected | ||
id: get-releases-affected | ||
run: | | ||
python .github/workflows/test.py ${{ steps.changed-files.outputs.all_changed_files }} | ||
# run: bash .github/workflows/get-releases | ||
# for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | ||
# echo "$file was changed" | ||
# done | ||
|
||
run: python scripts/get_releases_affected.py ${{ steps.changed-files.outputs.all_changed_files }} | ||
|
||
run-tests-and-publish-bundle-for-releases-affected: | ||
name: Publish bundle for releases affected to corresponding Charmhub channels | ||
runs-on: ubuntu-22.04 | ||
needs: [get-releases-affected] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
release: ${{ fromJson(needs.get-releases-affected.outputs.releases_affected) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# get-releases-affected: | ||
# [..] | ||
- name: Get bundle path for current release | ||
id: bundle-path | ||
run: python scripts/get_bundle_path.py ${{ matrix.release }} | ||
|
||
# run-tests-for-releases-affected: | ||
# needs: get-releases-affected | ||
# [..] | ||
# - name: Run tests for bundle release ${{ matrix.release }} | ||
# uses: action-for-bundle-tests | ||
# with: | ||
# bundle-path: ${{ steps.bundle-path.outputs.bundle_path }} | ||
|
||
# publish-charm: | ||
# needs: run-tests-for-releases-affected | ||
# [..] | ||
- name: Publish bundle for release ${{ matrix.release }} to Charmhub | ||
run: | | ||
echo release is ${{ matrix.release }} | ||
echo bundle path is ${{ steps.bundle-path.outputs.bundle_path }} | ||
# uses: canonical/charming-actions/[email protected] | ||
# with: | ||
# credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }} | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# bundle-path: ${{ steps.bundle-path.outputs.bundle_path }} | ||
# channel: ${{ matrix.release }} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Get bundle path for specific release | ||
import re | ||
import sys | ||
import os.path | ||
import json | ||
|
||
def get_bundle_path_from_release() -> None: | ||
if len(sys.argv)>1: | ||
release = sys.argv[1] | ||
bundle_is_latest = re.search("^latest/", release) | ||
if(bundle_is_latest): | ||
bundle_path = "releases/" + release + "/bundle.yaml" | ||
else: | ||
bundle_path = "releases/" + release + "/kubeflow/bundle.yaml" | ||
|
||
# Check if file in bundle_path output exists | ||
# Expect the script to be executed from `bundle-kubeflow` repo directory | ||
if(os.path.exists(bundle_path)): | ||
bundle_path_json = json.dumps(bundle_path) | ||
print(f"Outputting bundle_path in JSON format: {bundle_path_json}") | ||
print(f'::set-output name=bundle_path::{bundle_path_json}') | ||
else: | ||
raise Exception(f"There is no file in path: {bundle_path}") | ||
else: | ||
raise Exception("No release given as input.") | ||
|
||
get_bundle_path_from_release() |
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