Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump major version #1

Open
wants to merge 49 commits into
base: improve-gha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2cbb8aa
add release scripts, actions and documentation
getzze Sep 16, 2024
a44738d
add news
getzze Nov 5, 2024
21fe9d6
update MANIFEST
getzze Nov 5, 2024
b95baf0
remove force using Diaoul repo
getzze Nov 11, 2024
b1c90f0
bump to 3.0.1-dev
getzze Nov 11, 2024
15b3941
change repo
getzze Nov 11, 2024
51132e8
add creds to git
getzze Nov 11, 2024
9addc3f
de-bump version
getzze Nov 11, 2024
45ffc32
print more details
getzze Nov 12, 2024
22f4171
correct steps
getzze Nov 12, 2024
566300d
correct typos
getzze Nov 12, 2024
a80bbd5
correct tag version match
getzze Nov 12, 2024
ace7436
check docs
getzze Nov 12, 2024
293fcbb
towncrier build
getzze Nov 12, 2024
32ea81c
do not skip doc tests
getzze Nov 12, 2024
19ced9e
towncrier template
getzze Nov 12, 2024
6620c7a
Prepare release version 2.3.0dev
Nov 12, 2024
1a3042b
Merge pull request #5 from getzze/release-2.3.0dev
getzze Nov 12, 2024
3af3c1e
correct tag
getzze Nov 12, 2024
1f0494e
Prepare release version 2.2.2dev2
Nov 12, 2024
8afba02
Merge pull request #6 from getzze/release-2.2.2dev2
getzze Nov 12, 2024
7e9a83d
correct tag
getzze Nov 12, 2024
f16baf7
Prepare release version 2.2.2dev3
Nov 12, 2024
3754b32
Merge pull request #7 from getzze/release-2.2.2dev3
getzze Nov 12, 2024
9fa4065
correct tag
getzze Nov 12, 2024
57c4809
Prepare release version 2.2.2dev4
Nov 12, 2024
98333ea
Merge pull request #8 from getzze/release-2.2.2dev4
getzze Nov 12, 2024
90b4e22
correct tag
getzze Nov 12, 2024
40a2160
Prepare release version 2.2.2dev5
Nov 12, 2024
a31dd94
Merge pull request #9 from getzze/release-2.2.2dev5
getzze Nov 12, 2024
1a4d08c
correct tag
getzze Nov 12, 2024
72d74c7
rephrase
getzze Nov 12, 2024
78e38c8
Prepare release version 2.2.2dev6
Nov 12, 2024
db6b254
Merge pull request #10 from getzze/release-2.2.2dev6
getzze Nov 12, 2024
688d9b7
rephrase
getzze Nov 12, 2024
22e190c
better specify event
getzze Nov 12, 2024
f2db783
Prepare release version 2.2.2dev7
Nov 12, 2024
aa51d89
Merge pull request #11 from getzze/release-2.2.2dev7
getzze Nov 12, 2024
7b4076b
split tag and publish
getzze Nov 12, 2024
d6d438f
Prepare release version 2.2.2dev8
Nov 12, 2024
177cf54
Merge pull request #12 from getzze/release-2.2.2dev8
getzze Nov 12, 2024
4cb8c14
up schedule-tests
getzze Nov 12, 2024
90cbab4
other
getzze Nov 12, 2024
1e3f2a3
Prepare release version 2.2.2dev10
Nov 12, 2024
4d398a4
Merge pull request #13 from getzze/release-2.2.2dev10
getzze Nov 12, 2024
c8fc1dc
use workflow_run
getzze Nov 12, 2024
fbff09f
Prepare release version 2.2.2dev11
Nov 12, 2024
be39c29
Merge pull request #14 from getzze/release-2.2.2dev11
getzze Nov 12, 2024
f762228
update job description
getzze Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/prepare-release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Prepare release PR

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to base the release from'
required: false
default: 'main'
bump:
description: |
'Release type: major, minor or patch. '
'Leave empty for autommatic detection based on changelog segments.'
required: false
default: ''
prerelease:
description: 'Prerelease (ex: rc1). Leave empty if not a pre-release.'
required: false
default: ''

# Set permissions at the job level.
permissions: {}

env:
FORCE_COLOR: "1"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version-default
cache: pip

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

- name: Prepare release PR
run: |
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --bump='${{ github.event.inputs.bump }}' --prerelease='${{ github.event.inputs.prerelease }}'
109 changes: 52 additions & 57 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,82 @@ on:
push:
tags:
- '*'
workflow_run:
workflows: ["Tag release"]
types:
- completed
release:
types:
- published

permissions:
contents: read
id-token: write

env:
FORCE_COLOR: "1"

# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
jobs:
deploy:
# Always build & lint package.
build-package:
name: Build & verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- uses: actions/upload-artifact@v4
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v2

github-release:
name: Make a GitHub Release
needs: [build-package]
# only publish a Github release on push tag
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|| github.event_name == 'workflow_run'
runs-on: ubuntu-latest

permissions:
# IMPORTANT: mandatory for making GitHub Releases
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist/*
path: dist

- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
draft: true

publish-to-pypi:
needs: [deploy]
name: Publish package to pypi.
needs: [build-package]
environment:
name: pypi
url: https://pypi.org/p/subliminal
permissions:
id-token: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
# only publish to PyPI on Github release published
if: |
github.repository == 'Diaoul/subliminal'
&& github.event_name == 'release'
&& github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
Expand All @@ -50,46 +88,3 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs: [publish-to-pypi]
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: Packages
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release Draft
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--generate-notes
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
11 changes: 7 additions & 4 deletions .github/workflows/schedule-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: Test-APIs
name: Scheduled Tests

on:
schedule:
- cron: "12 12 12 * *" # run once a month on the 12th at 12:12
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test-api:
name: Test APIs
if: github.repository == 'Diaoul/subliminal' && github.event_name == 'schedule'
test-providers:
name: Test providers with real requests
if: |
(github.repository == 'Diaoul/subliminal' && github.event_name == 'schedule')
|| github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Tag release

on:
pull_request:
types:
- closed
workflow_dispatch:
inputs:
version:
description: 'Release tag version.'
type: string
default: NONE
required: true

permissions:
contents: read
id-token: write

env:
FORCE_COLOR: "1"

# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
jobs:
# Always build & lint package.
build-package:
name: Build & verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v2

tag:
name: Tag a new release
# tag a release after a release PR was accepted
if: |
github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
&& startsWith(github.head_ref, 'release-')
needs: [build-package]
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Tag the commit
run: |
RELEASE_VERSION=${GITHUB_HEAD_REF#release-}
echo Release version: $RELEASE_VERSION
git config user.name 'subliminal bot'
git config user.email [email protected]
git tag --annotate --message="Release version $RELEASE_VERSION" $RELEASE_VERSION ${{ github.sha }}
git push origin $RELEASE_VERSION
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
exclude: ^tests/cassettes/
- id: end-of-file-fixer

- repo: https://github.com/crate-ci/typos
rev: v1.24.5
rev: v1.27.3
hooks:
- id: typos

Expand Down
Loading