fix-build #4
@ -101,10 +101,15 @@ jobs:
|
|||||||
|
|
||||||
# Merge all built modules into one modules/ folder, wrap it in a single
|
# Merge all built modules into one modules/ folder, wrap it in a single
|
||||||
# repo-named top folder alongside the helper scripts (selftest.sh, launch.sh)
|
# repo-named top folder alongside the helper scripts (selftest.sh, launch.sh)
|
||||||
# and the iecpoc Python frontend (so launch.sh can pip-install it on the Pi),
|
# and the iecpoc Python frontend (so launch.sh can pip-install it on the Pi).
|
||||||
# and zip it. Runs on BOTH triggers and uploads the zip as an artifact: on a PR
|
# Runs on BOTH triggers and uploads the assembled FOLDER as an artifact: on a PR
|
||||||
# this lets you download and smoke-test the exact archive a release would ship;
|
# this lets you download and smoke-test the exact tree a release would ship; on a
|
||||||
# on a tag the release job below republishes this same artifact unchanged.
|
# tag the release job below zips this same tree and attaches it.
|
||||||
|
#
|
||||||
|
# We intentionally upload the folder, not a pre-made .zip: artifacts are always
|
||||||
|
# transported as a zip by the platform, so uploading a .zip would nest one zip
|
||||||
|
# inside another. Uploading the tree makes the platform's wrapper zip *be* the
|
||||||
|
# package archive (a single, clean layer).
|
||||||
package:
|
package:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -129,7 +134,7 @@ jobs:
|
|||||||
esac
|
esac
|
||||||
echo "ver=$v" >> "$GITHUB_OUTPUT"
|
echo "ver=$v" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Assemble package zip
|
- name: Assemble package tree
|
||||||
run: |
|
run: |
|
||||||
repo="${{ github.event.repository.name }}"
|
repo="${{ github.event.repository.name }}"
|
||||||
root="package/$repo"
|
root="package/$repo"
|
||||||
@ -143,32 +148,40 @@ jobs:
|
|||||||
cp pyproject.toml README.md "$root"/
|
cp pyproject.toml README.md "$root"/
|
||||||
cp -r iecpoc "$root"/
|
cp -r iecpoc "$root"/
|
||||||
find "$root/iecpoc" -name __pycache__ -type d -prune -exec rm -rf {} +
|
find "$root/iecpoc" -name __pycache__ -type d -prune -exec rm -rf {} +
|
||||||
(cd package && zip -r "../${repo}-${{ steps.ver.outputs.ver }}.zip" "$repo")
|
|
||||||
|
|
||||||
- name: Upload package zip
|
- name: Upload package
|
||||||
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.repository.name }}-${{ steps.ver.outputs.ver }}
|
name: ${{ github.event.repository.name }}-${{ steps.ver.outputs.ver }}
|
||||||
path: ${{ github.event.repository.name }}-*.zip
|
# Upload the contents of package/, so the artifact zip contains the
|
||||||
|
# single top folder package/<repo>/ -> <repo>/...
|
||||||
|
path: package
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
# Release flow only: takes the zip the package job already built and attaches it
|
# Release flow only: download the assembled tree the package job uploaded, zip it
|
||||||
# to the Gitea release for the pushed tag. No re-assembly here. Skipped on PRs.
|
# into the named release asset and attach it to the Gitea release for the pushed
|
||||||
|
# tag. No re-assembly here (the tree is taken as-is). Skipped on PRs.
|
||||||
release:
|
release:
|
||||||
needs: package
|
needs: package
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download package zip
|
- name: Download package
|
||||||
uses: https://github.com/christopherHX/gitea-download-artifact@v4
|
uses: https://github.com/christopherHX/gitea-download-artifact@v4
|
||||||
with:
|
with:
|
||||||
# The single artifact the package job produced for this tag.
|
# The single artifact the package job produced for this tag; extracts to
|
||||||
|
# dist/<repo>/...
|
||||||
name: ${{ github.event.repository.name }}-${{ github.ref_name }}
|
name: ${{ github.event.repository.name }}-${{ github.ref_name }}
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
|
- name: Zip release asset
|
||||||
|
run: |
|
||||||
|
repo="${{ github.event.repository.name }}"
|
||||||
|
(cd dist && zip -r "../${repo}-${{ github.ref_name }}.zip" "$repo")
|
||||||
|
|
||||||
- name: Publish to Gitea release
|
- name: Publish to Gitea release
|
||||||
uses: https://gitea.com/actions/gitea-release-action@v1.3.6
|
uses: https://gitea.com/actions/gitea-release-action@v1.3.6
|
||||||
with:
|
with:
|
||||||
api_key: ${{ secrets.GITEA_TOKEN }}
|
api_key: ${{ secrets.GITEA_TOKEN }}
|
||||||
files: |-
|
files: |-
|
||||||
dist/*.zip
|
${{ github.event.repository.name }}-${{ github.ref_name }}.zip
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user