1- # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2- #
3- # SPDX-License-Identifier: MIT
4-
5- name : Release Actions
1+ name : Release
62
73on :
84 release :
117
128jobs :
139 upload-release-assets :
14- if : github.event_name != 'workflow_dispatch' && github.repository == '2bndy5/CircuitPython_Homie'
1510 runs-on : ubuntu-latest
1611 steps :
1712 - name : Translate Repo Name For Build Tools filename_prefix
1813 id : repo-name
1914 run : |
20- echo ::set-output name= repo-name:: $(
15+ echo repo-name= $(
2116 echo ${{ github.repository }} |
2217 awk -F '\/' '{ print tolower($2) }' |
2318 tr '_' '-'
24- )
19+ ) >> $GITHUB_OUTPUT
2520
2621 - name : Translate Repo Name For Build Tools package_prefix
2722 id : pkg-name
2823 run : |
29- echo ::set-output name= pkg-name:: $(
24+ echo pkg-name= $(
3025 echo ${{ github.repository }} |
3126 awk -F '\/' '{ print tolower($2) }'
32- )
27+ ) >> $GITHUB_OUTPUT
3328
3429 - name : Set up Python 3.x
35- uses : actions/setup-python@v2
30+ uses : actions/setup-python@v4
3631 with :
3732 python-version : " 3.x"
3833
3934 - name : Checkout Current Repo
4035 uses : actions/checkout@v3
4136 with :
42- submodules : true
4337 fetch-depth : 0
4438
4539 - name : Checkout tools repo
@@ -55,17 +49,20 @@ jobs:
5549 - name : Build assets
5650 run : circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --package_folder_prefix ${{ steps.pkg-name.outputs.pkg-name }} --library_location .
5751
52+ - name : Archive bundles
53+ if : github.event_name == 'workflow_dispatch'
54+ uses : actions/upload-artifact@v3
55+ with :
56+ name : bundles
57+ path : ${{ github.workspace }}/bundles/
58+
5859 - name : Upload Release Assets
59- # the 'official' actions version does not yet support dynamically
60- # supplying asset names to upload. @csexton's version chosen based on
61- # discussion in the issue below, as its the simplest to implement and
62- # allows for selecting files with a pattern.
63- # https://github.com/actions/upload-release-asset/issues/4
64- 65- uses : csexton/release-asset-action@master
60+ if : github.event_name == 'release'
61+ uses : shogo82148/actions-upload-release-asset@v1
6662 with :
67- pattern : " bundles/*"
68- github-token : ${{ secrets.GITHUB_TOKEN }}
63+ upload_url : ${{ github.event.release.upload_url }}
64+ asset_path : " bundles/**"
65+ asset_name : " bundles"
6966
7067 upload-pypi :
7168 runs-on : ubuntu-latest
7471 with :
7572 fetch-depth : 0
7673
77- - uses : actions/setup-python@v2
74+ - uses : actions/setup-python@v4
7875 with :
7976 python-version : ' 3.x'
8077
9794 run : twine upload --repository testpypi dist/*
9895
9996 - name : Publish package (to PyPI)
100- if : github.event_name != 'workflow_dispatch ' && github.repository == '2bndy5/CircuitPython_Homie'
97+ if : github.event_name == 'release ' && github.repository == '2bndy5/CircuitPython_Homie'
10198 env :
10299 TWINE_USERNAME : __token__
103100 TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments