File: release.yml

package info (click to toggle)
python-cobra 0.29.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,512 kB
  • sloc: python: 14,703; xml: 12,841; makefile: 137; sh: 30
file content (60 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download
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
55
56
57
58
59
60
name: CD

on:
  push:
    tags:
    - "[0-9]+.[0-9]+.[0-9]+"
    - "[0-9]+.[0-9]+.[0-9]+(a|b|rc|post|dev)[0-9]+"

jobs:
  prerequisites:
    uses: ./.github/workflows/test.yml

  release:
    needs: [prerequisites]
    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: ["3.11"]
    runs-on: ${{ matrix.os }}
    permissions:
      # Write permissions are needed to create OIDC tokens.
      id-token: write
      # Write permissions are needed to make GitHub releases.
      contents: write

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip setuptools wheel
        python -m pip install build

    - name: Build package
      run: python -m build

    # We rely on a trusted publisher configuration being present on PyPI,
    # see https://docs.pypi.org/trusted-publishers/.
    - name: Publish to PyPI
      uses: pypa/gh-action-pypi-publish@release/v1

    - name: GH release
      uses: softprops/action-gh-release@v2
      with:
        body_path: "release-notes/${{ github.ref_name }}.md"
        draft: false
        prerelease: false

    - name: Publish to website
      run: ./scripts/deploy_website.sh
      shell: bash
      env:
        TAG: ${{ github.ref_name }}
        WORKSPACE: ${{ github.workspace }}
        WEBSITE_DEPLOY_TOKEN: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}