Skip to content

Commit

Permalink
Adjust build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
apbassett committed Jan 3, 2024
1 parent d952415 commit 5944ab7
Showing 1 changed file with 55 additions and 51 deletions.
106 changes: 55 additions & 51 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,8 @@ jobs:
howso-engine-build: ${{ inputs.howso-engine-build }}
amalgam-lang-py-build: ${{ inputs.amalgam-lang-py-build }}

get-howso-engine-details:
needs: ["metadata"]
uses: "howsoai/.github/.github/workflows/get-dependency-details.yml@main"
secrets: inherit
with:
owner: "howsoai"
repo: "howso-engine"
payload: ${{ needs.metadata.outputs.upstream-details }}

get-amalgam-lang-py-details:
needs: ["metadata"]
uses: "howsoai/.github/.github/workflows/get-dependency-details.yml@main"
secrets: inherit
with:
owner: "howsoai"
repo: "amalgam-lang-py"
payload: ${{ needs.metadata.outputs.upstream-details }}
skip-version-json-check: true

build:
needs: ["metadata", "get-howso-engine-details"]
needs: ["metadata"]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -75,7 +56,9 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-howso-engine-details.outputs.run-type }} download -D howso/howso-engine/tmp -R "howsoai/howso-engine" -p "howso-engine-*" "${{ needs.get-howso-engine-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".run_type')
gh $run_type download -D howso/howso-engine/tmp -R "howsoai/howso-engine" -p "howso-engine-*" "$run_id"
# Needed because release/non-release downloads are different structure
cd howso/howso-engine/tmp && if [ ! -f *.tar.gz ]; then mv */*.tar.gz ./; fi && tar -xvzf *.tar.gz
Expand All @@ -93,14 +76,19 @@ jobs:
- name: Set workflow run info
run: |
cd howso/howso-engine
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".run_type')
build_title=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".build_title')
build_date=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".build_date')
head_sha=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".head_sha')
url=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."howso-engine".url')
# Set the display title and build date info in version.json
if [[ -n '${{ needs.get-howso-engine-details.outputs.build-title }}' ]]; then
jq '. |= . + {"display_title": ${{ needs.get-howso-engine-details.outputs.build-title }}}' version.json > temp.json && mv temp.json version.json
jq '. |= . + {"build_date": ${{ needs.get-howso-engine-details.outputs.build-date }}}' version.json > temp.json && mv temp.json version.json
if [[ -n 'build_title' ]]; then
jq '. |= . + {"display_title": $build_title}' version.json > temp.json && mv temp.json version.json
jq '. |= . + {"build_date": $build_date}' version.json > temp.json && mv temp.json version.json
fi
jq '. |= . + {"sha": ${{ needs.get-howso-engine-details.outputs.head-sha }}}' version.json > temp.json && mv temp.json version.json
jq '. |= . + {"url": ${{ needs.get-howso-engine-details.outputs.url }}}' version.json > temp.json && mv temp.json version.json
jq '. |= . + {"sha": $head_sha}' version.json > temp.json && mv temp.json version.json
jq '. |= . + {"url": $url}' version.json > temp.json && mv temp.json version.json
cat version.json
- name: Compare Amalagam versions
Expand Down Expand Up @@ -253,7 +241,7 @@ jobs:
upstream-details: ${{ needs.metadata.outputs.upstream-details }}

install-verification-linux-amd64:
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: ubuntu-latest
steps:

Expand All @@ -263,11 +251,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand All @@ -291,7 +281,7 @@ jobs:
install-verification-linux-arm64:
if: inputs.build-type != 'PR'
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: ubuntu-latest
steps:

Expand All @@ -301,11 +291,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand Down Expand Up @@ -343,7 +335,7 @@ jobs:
install-verification-linux-arm64_8a:
if: inputs.build-type != 'PR'
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: ubuntu-latest
steps:

Expand All @@ -353,11 +345,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand Down Expand Up @@ -406,7 +400,7 @@ jobs:
install-verification-windows-bash-amd64:
if: inputs.build-type != 'PR'
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: windows-latest
steps:

Expand All @@ -418,11 +412,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand Down Expand Up @@ -450,7 +446,7 @@ jobs:
PYTHONUTF8=1 verify_howso_install
install-verification-windows-cmd-amd64:
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: windows-latest
steps:

Expand All @@ -462,11 +458,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand Down Expand Up @@ -501,7 +499,7 @@ jobs:
install-verification-windows-pwsh-amd64:
if: inputs.build-type != 'PR'
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: windows-latest
steps:

Expand All @@ -513,11 +511,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand Down Expand Up @@ -549,7 +549,7 @@ jobs:
verify_howso_install
install-verification-macos-amd64:
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: macos-latest-large
steps:

Expand All @@ -559,11 +559,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand All @@ -586,7 +588,7 @@ jobs:
verify_howso_install
install-verification-macos-arm64:
needs: ['metadata', 'get-amalgam-lang-py-details', 'build']
needs: ['metadata', 'build']
runs-on: macos-latest-xlarge
steps:

Expand All @@ -596,11 +598,13 @@ jobs:
name: howso_engine-${{ needs.metadata.outputs.version }}-py3-none-any

- name: Download amalgam-lang-py
if: needs.get-amalgam-lang-py-details.outputs.run-type != ''
if: inputs.amalgam-lang-py-build != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
gh ${{ needs.get-amalgam-lang-py-details.outputs.run-type }} download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "${{ needs.get-amalgam-lang-py-details.outputs.run-id }}"
run_id=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_id')
run_type=$(printf "%s" '${{ needs.metadata.outputs.upstream-details }}' | jq -r '."amalgam-lang-py".run_type')
gh $run_type download -D tmp -R "howsoai/amalgam-lang-py" -p "amalgam_lang-*-py3-none-any" "$run_id"
# Needed because release/non-release downloads are different structure
cd tmp && if [ ! -f *.whl ]; then mv */*.whl ./; fi
Expand Down

0 comments on commit 5944ab7

Please sign in to comment.