Skip to content

Commit

Permalink
👷‍♂️ Use environment in CI Publish Actions (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaversaccio authored Oct 13, 2023
1 parent 4ff7a35 commit 173b53b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 👮‍♂️ Sanity checks

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ name: 📦 Publish 🐍 snekmate to npm
on:
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ${{ matrix.os }}
environment:
name: npm
url: https://www.npmjs.com/package/snekmate
strategy:
matrix:
os:
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ name: 📦 Publish 🐍 snekmate to PyPI
on:
release:
types: [published]
workflow_dispatch:

jobs:
build-n-publish:
runs-on: ${{ matrix.os }}
environment:
name: pypi
url: https://pypi.org/project/snekmate
permissions:
id-token: write
strategy:
Expand Down Expand Up @@ -36,13 +40,19 @@ jobs:
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
run: python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
23 changes: 16 additions & 7 deletions .github/workflows/publish-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on: [workflow_dispatch]
jobs:
build-n-publish:
runs-on: ${{ matrix.os }}
environment:
name: test-pypi
url: https://test.pypi.org/project/snekmate
permissions:
id-token: write
strategy:
Expand Down Expand Up @@ -34,13 +37,19 @@ jobs:
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
run: python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-contracts.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 🕵️‍♂️ Test smart contracts

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
Expand Down

0 comments on commit 173b53b

Please sign in to comment.