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

Automated publishing, Makefile cleanup, Black, improved release instructions #286

Merged
merged 20 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules
*.min.js
**/lib/
public/
coverage/
**/vendor/
docs/_build
sphinx_wagtail_theme/static
14 changes: 0 additions & 14 deletions .github/actions/setup-firefox/action.yml

This file was deleted.

106 changes: 0 additions & 106 deletions .github/workflows/CI.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
qa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: npm ci
- run: make lint-frontend
- run: make frontend
- run: make install-python
- run: make lint-python
- run: make test

visual-regression-tests:
needs: qa
runs-on: ubuntu-latest
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: browser-actions/setup-firefox@v1
- run: make install-python
- run: npm ci
# Check against the dist version of the frontend, as it would be appear when deployed
- run: make frontend-dist
- run: make docs
- name: Percy Test
run: make test-visual-regression
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish to PyPI
on:
release:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
types: [released]
jobs:
test:
uses: ./.github/workflows/ci.yml

build:
needs: ['test']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install Node dependencies
run: |
npm ci

- name: Compile JavaScript
run: |
make frontend-dist

- uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: make setup-python

- name: Build package distributions
run: make build

- uses: actions/upload-artifact@v4
with:
path: ./dist

# https://docs.pypi.org/trusted-publishers/using-a-publisher/
pypi-publish:
needs: ['build']
environment: 'publish'

name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# Mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v4

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/
print-hash: true
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
*.egg
*.egg-info
*.pyc
*.sass-cache
*GENERATED*
*NOT_VERSIONED*
.coverage
.eggs/
.idea
.ruby-version
.tox
Expand All @@ -22,7 +17,7 @@ npm-debug.log
/.vscode

/build/*
!/build/.gitkeep
rtd-env/
venv/
env/
.env/
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:
nodejs: '20'
jobs:
post_install:
- make setup-frontend
- make install-frontend
pre_build:
- make frontend

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ All notable changes to this project will be documented in this file.
### Added

- Use new Wagtail logo variant for favicon and other logos (Osaf AliSayed)
- Set up GitHub Actions for publishing new releases using PyPI's trusted publishing (Storm Heg)

### Changed

- ...
- Clean up development and release instructions and format codebase with Black (Storm Heg)

### Removed

Expand Down
Loading