From 9004221a895f35ace026a621af741fe648b8f9a6 Mon Sep 17 00:00:00 2001 From: Ian Hunt-Isaak Date: Mon, 4 Jan 2021 12:15:52 -0500 Subject: [PATCH 1/2] add automated release workflow --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..b0092235 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Publish Package + +on: + release: + types: [published] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: '14.x' + registry-url: 'https://registry.npmjs.org' + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install packaging setuptools twine wheel + - name: Publish the Python package + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* + - name: Publish the NPM package + run: | + echo $PRE_RELEASE + if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi + npm publish --tag ${TAG} --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + PRE_RELEASE: ${{ github.event.release.prerelease }} From cd51fa06bf6e094a8cdf1ec8ca39a70adf1cc4aa Mon Sep 17 00:00:00 2001 From: Ian Hunt-Isaak Date: Mon, 22 Mar 2021 18:11:18 -0400 Subject: [PATCH 2/2] Use the new build command to generate the wheel --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0092235..2a3c9b33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,16 +20,17 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install packaging setuptools twine wheel + pip install twine wheel build - name: Publish the Python package env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - python setup.py sdist bdist_wheel + python -m build twine upload dist/* - name: Publish the NPM package run: | + cd js echo $PRE_RELEASE if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi npm publish --tag ${TAG} --access public