mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
updated manifest generation to include all data in each go
This commit is contained in:
parent
7859e5ea4c
commit
5c21140025
42
.github/workflows/manifest.yml
vendored
42
.github/workflows/manifest.yml
vendored
@ -29,27 +29,41 @@ jobs:
|
|||||||
url: ${{ steps.deployment.outputs.page_url }}
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v3
|
uses: actions/configure-pages@v3
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v3.1.3
|
uses: actions/setup-python@v3.1.3
|
||||||
- name: Extract branch name
|
- name: Create outputs folders
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
run: mkdir deploy; mkdir deploy/manifests; mkdir deploy/manifests/main deploy/manifests/latest deploy/manifests/devel
|
||||||
id: extract_branch
|
# Generate manifest + shields files for main branch
|
||||||
- name: Create outputs folder
|
- name: Checkout main
|
||||||
shell: bash
|
uses: actions/checkout@v3
|
||||||
run: mkdir deploy; mkdir deploy/manifests; mkdir deploy/manifests/${{ steps.extract_branch.outputs.branch }}
|
with:
|
||||||
|
ref: 'main'
|
||||||
- name: Generate manifest and shields for main branch
|
- name: Generate manifest and shields for main branch
|
||||||
if: github.event.pull_request.base.ref == 'main'
|
run: python imgen.py shields
|
||||||
run: python imgen.py gh_actions
|
- name: Save main's manifest
|
||||||
- name: Generate only manifest for non-main branches
|
run: mv install_manifest.json deploy/manifests/main
|
||||||
if: github.event.pull_request.base.ref != 'main'
|
# Generate manifest for latest branch
|
||||||
|
- name: Checkout latest
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: 'latest'
|
||||||
|
- name: Generate manifest for latest
|
||||||
run: python imgen.py
|
run: python imgen.py
|
||||||
- name: Move manifest
|
- name: Save latest's manifest
|
||||||
run: mv install_manifest.json deploy/manifests/${{ steps.extract_branch.outputs.branch }}
|
run: mv install_manifest.json deploy/manifests/latest
|
||||||
|
# Generate manifest for devel branch
|
||||||
|
- name: Checkout devel
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: 'devel'
|
||||||
|
- name: Generate manifest for devel
|
||||||
|
run: python imgen.py
|
||||||
|
- name: Save devel's manifest
|
||||||
|
run: mv install_manifest.json deploy/manifests/devel
|
||||||
|
# All artifacts ready now, upload deploy directory
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-pages-artifact@v1
|
uses: actions/upload-pages-artifact@v1
|
||||||
with:
|
with:
|
||||||
|
2
imgen.py
2
imgen.py
@ -108,7 +108,7 @@ f = open("install_manifest.json", "w")
|
|||||||
json.dump(final_manifest, f)
|
json.dump(final_manifest, f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
if len(sys.argv) > 1 and sys.argv[1] == "gh_actions":
|
if len(sys.argv) > 1 and sys.argv[1] == "shields":
|
||||||
# write all the JSON files for shields.io
|
# write all the JSON files for shields.io
|
||||||
for key, version in final_manifest["versions"].items():
|
for key, version in final_manifest["versions"].items():
|
||||||
f = open("./deploy/" + key + ".json", "w")
|
f = open("./deploy/" + key + ".json", "w")
|
||||||
|
Loading…
Reference in New Issue
Block a user