File: release.yml

package info (click to toggle)
sphinx-thebe 0.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 212 kB
  • sloc: python: 292; javascript: 92; makefile: 15
file content (54 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This will run every time a tag is created and pushed to the repository.
# It calls our tests workflow via a `workflow_call`, and if tests pass
# then it triggers our upload to PyPI for a new release.
name: Make a new release
on:
  push:
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+"
      - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"

jobs:
  tests:
    uses: ./.github/workflows/tests.yml
  dist:
    name: publish
    needs: [tests] # require tests to pass before deploy runs
    runs-on: ubuntu-latest
    steps:
      - name: Checkout source
        uses: actions/checkout@v3
      - name: Set up Python 3.11
        uses: actions/setup-python@v4
        with:
          python-version: 3.11
      - name: Build package
        run: pipx run build
      - uses: actions/upload-artifact@v3
        with:
          path: dist/*
  upload_pypi:
    name: publish
    needs: [dist]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v3
        with:
          name: artifact
          path: dist
      - name: Publish
        uses: pypa/gh-action-pypi-publish@v1.6.4
        with:
          user: __token__
          password: ${{ secrets.PYPI_KEY }}
  release:
    needs: [ upload_pypi ]
    name: Create release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: softprops/action-gh-release@v1
        with:
          name: Sphinx thebe ${{ github.ref_name }}
          prerelease: ${{ contains(github.ref, 'rc') }}
          generate_release_notes: true