From 70e4c73baae5759b6a2bae9722fa64cfb8b0bb20 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 18 Aug 2023 11:28:15 -0400 Subject: SL-18837: Engage initial GH viewer release script. --- .github/workflows/build.yaml | 38 +++++++++++++++++++++++++++---------- .github/workflows/post_artifacts.py | 31 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 10 deletions(-) create mode 100755 .github/workflows/post_artifacts.py (limited to '.github/workflows') 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)) -- cgit v1.2.3