File: release.yml

package info (click to toggle)
python-django-object-actions 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 296 kB
  • sloc: python: 738; makefile: 64; sh: 6
file content (47 lines) | stat: -rw-r--r-- 1,652 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
# https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html#examples
name: Release

on:
  workflow_dispatch:
  # Disabled to be able to roll multiple breaking releases into one release
  # push:
  #   branches:
  #     - main

jobs:
  release:
    runs-on: ubuntu-latest
    concurrency: release
    permissions:
      id-token: write
      contents: write

    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.ref_name }}
          fetch-depth: 0
          persist-credentials: false
      - name: Setup | Force release branch to be at workflow sha
        run: |
          git reset --hard ${{ github.sha }}
      - name: Action | Python Semantic Release
        id: release
        # https://github.com/python-semantic-release/python-semantic-release/releases
        # https://python-semantic-release.readthedocs.io/en/latest/github-action.html
        uses: python-semantic-release/python-semantic-release@v9.21.0
        with:
          github_token: ${{ secrets.BOT_GITHUB_TOKEN }}

      - name: Publish | Upload package to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        # NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
        # See https://github.com/actions/runner/issues/1173
        if: steps.release.outputs.released == 'true'

      - name: Publish | Upload to GitHub Release Assets
        uses: python-semantic-release/publish-action@v9.21.0
        if: steps.release.outputs.released == 'true'
        with:
          github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
          tag: ${{ steps.release.outputs.tag }}