Skip to content

Commit

Permalink
Move to using Trusted Publishers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed May 17, 2023
1 parent 3aaecbb commit 956e394
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
PYTHON_LATEST: "3.11"

jobs:
pre-commit:
Expand All @@ -21,7 +20,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
python-version: "3.x"
- uses: pre-commit/action@v3.0.0

list:
Expand Down Expand Up @@ -56,14 +55,14 @@ jobs:
run: >
sudo apt-get update &&
sudo apt-get install -y libenchant-2-dev
if: runner.os == 'Linux'
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
- name: Install dependencies
run: brew install enchant
if: runner.os == 'macOS'
if: runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs')
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
python-version: "3.x"
- name: Set up nox
uses: wntrblm/nox@2023.04.22
- name: Run nox
Expand All @@ -72,34 +71,30 @@ jobs:
packaging:
needs: ci
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/jsonschema-specifications
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_LATEST }}
python-version: "3.x"
- name: Install dependencies
run: python -m pip install build
- name: Create packages
run: python -m build .
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: Publish the package
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: actions/github-script@v6
uses: softprops/action-gh-release@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});
files: |
dist/*
generate_release_notes: true

0 comments on commit 956e394

Please sign in to comment.