-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (71 loc) · 2.17 KB
/
release.yml
File metadata and controls
85 lines (71 loc) · 2.17 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release and Publish package to PyPI
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
locale: C.UTF-8
env:
LC_ALL: ${{ matrix.locale }}
LANG: ${{ matrix.locale }}
steps:
##### Setup environment
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pip"
- name: Install Hatch
uses: pypa/hatch@install
- name: Print info about the current python installation
run: make ci-info
- name: Install requirements
run: make bootstrap-dev
##### Create release on GitHub
- name: Create or update GitHub release
run: scriv github-release --repo=codewithemad/tutor-contrib-wordpress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
##### Publish to PyPI
- name: Build and publish to PyPI
run: |
hatch build
hatch publish
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
build_and_push_image:
needs: release # Wait for release job to complete successfully
runs-on: ubuntu-latest
container: python:3.9-slim
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract tag
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Install Tutor
run: pip install tutor
- name: Install tutor-plugin-wordpress
run: pip install git+https://github.com/codewithemad/tutor-contrib-wordpress@${{ env.TAG }}
- name: Initialize Tutor
run: |
tutor config save --interactive=false
tutor plugins enable wordpress
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push WordPress image
run: |
tutor images build wordpress
tutor images push wordpress