-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (49 loc) · 2.6 KB
/
Copy pathdeploy.yaml
File metadata and controls
57 lines (49 loc) · 2.6 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
# This workflow will build the CoRelAy project and publish the artifacts to PyPI when a GitHub release is created
name: CoRelAy Continuous Deployment
# This workflow will run when a new release is created on GitHub, the process works like this:
# 1) For each milestone multiple issues are created
# 2) For each issue a new branch is branched off from the develop branch (which itself is branched off from main)
# 3) When the issue is resolved, a pull request is created to merge the issue branch into the develop branch
# 4) Once all issues for a milestone are resolved, a pull request is created to merge the develop branch into the main branch
# 5) When the pull request is merged, a new release is created
# 6) This workflow will then be triggered and the CoRelAy project will be built and published to PyPI
on:
release:
types:
- created
# This workflow contains a single job for building and publishing the CoRelAy project
jobs:
# Builds and publishes the CoRelAy project
build-and-publish:
# The job will run on the latest version of Ubuntu
name: Build and Publish the CoRelAy Project
runs-on: ubuntu-latest
# Gives the job permission to write the ID token, which is required for trusted publishing; trusted publishing is a way to publish packages to a
# package index (like PyPI) without needing to store credentials in the repository; trusted publishing is set up beforehand and during the
# publishing step and allows the job to automatically authenticate with the package index to retrieve a JWT token for publishing the package; the
# write permission is allows GitHub to generate an OIDC token, which is used to authenticate with the package index and retrieve the JWT token
permissions:
id-token: write
# Specifies that we want to deploy to PyPI
environment:
name: pypi
url: https://pypi.org/p/corelay
# The job contains several steps: 1) checking out the repository, 2) installing the Python project management tool uv, 3) installing Python, 4)
# installing the dependencies of CoRelAy, 5) building the CoRelAy project, and 6) publishing the CoRelAy project
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 0.6.13
- name: Install Python
run: uv python install
- name: Install CoRelAy and its Dependencies
run: uv sync --locked
- name: Build the CoRelAy Project
run: uv build
- name: Publish the CoRelAy Project to PyPI
run: uv publish