Skip to content

Commit 7fa4c87

Browse files
committed
update CI workflows
1. fix `set-output` commands according to github's deprecation notice 2. switch to a more maintained action for uploading release assets.
1 parent d14630c commit 7fa4c87

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,19 @@ jobs:
8787
- name: Translate Repo Name For Build Tools filename_prefix
8888
id: repo-name
8989
run: |
90-
echo ::set-output name=repo-name::$(
90+
echo repo-name=$(
9191
echo ${{ github.repository }} |
9292
awk -F '\/' '{ print tolower($2) }' |
9393
tr '_' '-'
94-
)
94+
) >> $GITHUB_OUTPUT
9595
9696
- name: Translate Repo Name For Build Tools package_prefix
9797
id: pkg-name
9898
run: |
99-
echo ::set-output name=pkg-name::$(
99+
echo pkg-name=$(
100100
echo ${{ github.repository }} |
101101
awk -F '\/' '{ print tolower($2) }'
102-
)
102+
) >> $GITHUB_OUTPUT
103103
104104
- uses: actions/checkout@v3
105105

.github/workflows/release.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
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

73
on:
84
release:
@@ -11,35 +7,33 @@ on:
117

128
jobs:
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-
#uses: actions/[email protected]
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
@@ -74,7 +71,7 @@ jobs:
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

@@ -97,7 +94,7 @@ jobs:
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

Comments
 (0)