diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-08-18 11:28:15 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-08-18 11:28:15 -0400 |
commit | 70e4c73baae5759b6a2bae9722fa64cfb8b0bb20 (patch) | |
tree | 56633a3cb19ef68e10c9fda209265a27b5f2378c | |
parent | 73a857ba31a21add60db349fc29fb9f7a5edfa00 (diff) |
SL-18837: Engage initial GH viewer release script.
-rw-r--r-- | .github/workflows/build.yaml | 38 | ||||
-rwxr-xr-x | .github/workflows/post_artifacts.py | 31 |
2 files changed, 59 insertions, 10 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 01f7f2bd7b..1cdef55f5f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -241,16 +241,34 @@ jobs: release: needs: build - runs-on: [ubuntu-latest] + runs-on: ubuntu-latest if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_') steps: - # forked from softprops/action-gh-release - - uses: secondlife-3p/action-gh-release@v1 + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.sha }} + + - name: Setup python + uses: actions/setup-python@v4 with: - prerelease: true - generate_release_notes: true - # the only reason we generate a GH release is to post build products - fail_on_unmatched_files: true - files: | - ${{ needs.build.outputs.installer }} - ${{ needs.build.outputs.metadata }} + python-version: "3.11" + + - name: Install PyGithub + run: pip3 install PyGithub + + - name: Unpack artifacts + env: + BUILD: ${{ toJSON(needs.build) }} + run: .github/workflows/post_artifacts.py + +## # forked from softprops/action-gh-release +## - uses: secondlife-3p/action-gh-release@v1 +## with: +## prerelease: true +## generate_release_notes: true +## # the only reason we generate a GH release is to post build products +## fail_on_unmatched_files: true +## files: | +## ${{ needs.build.outputs.installer }} +## ${{ needs.build.outputs.metadata }} diff --git a/.github/workflows/post_artifacts.py b/.github/workflows/post_artifacts.py new file mode 100755 index 0000000000..bb51feb0a9 --- /dev/null +++ b/.github/workflows/post_artifacts.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""\ +@file post_artifacts.py +@author Nat Goodspeed +@date 2023-08-18 +@brief Unpack and post artifacts from a GitHub Actions build + +$LicenseInfo:firstyear=2023&license=viewerlgpl$ +Copyright (c) 2023, Linden Research, Inc. +$/LicenseInfo$ +""" + +import github +import json +import os +import sys + +class Error(Exception): + pass + +def main(*raw_args): + buildstr = os.getenv('BUILD') + build = json.loads(buildstr) + from pprint import pprint + pprint(build) + +if __name__ == "__main__": + try: + sys.exit(main(*sys.argv[1:])) + except Error as err: + sys.exit(str(err)) |