diff options
author | Peter van Dijk <peter.van.dijk@powerdns.com> | 2021-11-07 21:05:10 +0100 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2021-11-08 18:59:36 -1000 |
commit | a40c1b3e442eccbf0619f06b473705f4a4a0ac6d (patch) | |
tree | 71fcc309eda12d08958941e8f0aa087d94381042 /.github | |
parent | 1f612854632d96fff036d8275f78981d9014affa (diff) |
CI: add PKG-INFO metadata file
Signed-off-by: Peter van Dijk <peter.van.dijk@powerdns.com>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/multi-arch-test-build.yml | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/.github/workflows/multi-arch-test-build.yml b/.github/workflows/multi-arch-test-build.yml index c17063b1d..cd5b93f44 100644 --- a/.github/workflows/multi-arch-test-build.yml +++ b/.github/workflows/multi-arch-test-build.yml @@ -95,17 +95,57 @@ jobs: - name: Move created packages to project dir run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true + - name: Collect metadata + run: | + MERGE_ID=$(git rev-parse --short HEAD) + echo "MERGE_ID=$MERGE_ID" >> $GITHUB_ENV + echo "BASE_ID=$(git rev-parse --short HEAD^1)" >> $GITHUB_ENV + echo "HEAD_ID=$(git rev-parse --short HEAD^2)" >> $GITHUB_ENV + PRNUMBER=${GITHUB_REF_NAME%/merge} + echo "PRNUMBER=$PRNUMBER" >> $GITHUB_ENV + echo "ARCHIVE_NAME=${{matrix.arch}}-PR$PRNUMBER-$MERGE_ID" >> $GITHUB_ENV + + - name: Generate metadata + run: | + cat << _EOF_ > PKG-INFO + Metadata-Version: 2.1 + Name: ${{env.ARCHIVE_NAME}} + Version: $BRANCH + Author: $GITHUB_ACTOR + Home-page: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/$PRNUMBER + Download-URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID + Summary: $PACKAGES + Platform: ${{ matrix.arch }} + + Packages for OpenWrt $BRANCH running on ${{matrix.arch}}, built from PR $PRNUMBER + at commit $HEAD_ID, against $BRANCH at commit $BASE_ID, with merge SHA $MERGE_ID. + + Modified packages: + _EOF_ + for p in $PACKAGES + do + echo " "$p >> PKG-INFO + done + echo >> PKG-INFO + echo Full file listing: >> PKG-INFO + ls -al *.ipk >> PKG-INFO + cat PKG-INFO + - name: Store packages uses: actions/upload-artifact@v2 with: - name: ${{ matrix.arch}}-${{ github.sha}}-packages - path: "*.ipk" + name: ${{env.ARCHIVE_NAME}}-packages + path: | + *.ipk + PKG-INFO - name: Store logs uses: actions/upload-artifact@v2 with: - name: ${{ matrix.arch}}-${{ github.sha}}-logs - path: logs/ + name: ${{env.ARCHIVE_NAME}}-logs + path: | + logs/ + PKG-INFO - name: Remove logs run: sudo rm -rf logs/ || true |