Skip to content

Commit c30feb3

Browse files
committed
ci/cd: add release automation
Publishes a release when tagged with a `semver` version: - X.Y.Z for "production quality" (1.0.0) - X.Y.Z-suffix for development (1.0.0-alpha.1) Release will be marked as 'prerelease' accordingly. For now, any release will be marked 'draft'.
1 parent 4c81589 commit c30feb3

File tree

3 files changed

+97
-29
lines changed

3 files changed

+97
-29
lines changed

.github/workflows/build.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Build Reticulum
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- "[0-9]+.[0-9]+.[0-9]+*"
9+
pull_request:
10+
branches:
11+
- master
12+
paths-ignore:
13+
- .gitignore
14+
- LICENSE
15+
16+
permissions:
17+
contents: write
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: false
22+
23+
jobs:
24+
test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: 3.x
32+
- run: make test
33+
34+
package:
35+
needs: test
36+
if: startsWith(github.ref, 'refs/tags/')
37+
runs-on: ubuntu-latest
38+
environment: ${{ contains(github.ref, '-') && 'development' || 'production' }}
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: 3.x
45+
- run: |
46+
python -m pip install -q build wheel setuptools
47+
make remove_symlinks
48+
make build_wheel
49+
make build_pure_wheel
50+
make create_symlinks
51+
- uses: actions/upload-artifact@v4
52+
with:
53+
name: package
54+
path: dist/*.whl
55+
56+
documentation:
57+
needs: test
58+
if: startsWith(github.ref, 'refs/tags/')
59+
runs-on: ubuntu-latest
60+
environment: ${{ contains(github.ref, '-') && 'development' || 'production' }}
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-python@v5
64+
with:
65+
python-version: 3.x
66+
- run: |
67+
sudo apt-get -qq update && sudo apt-get -qq install latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
68+
python -m pip -q install sphinx sphinx-copybutton
69+
cd docs && make latexpdf && make epub
70+
- uses: actions/upload-artifact@v4
71+
with:
72+
name: documentation
73+
path: |
74+
docs/build/latex/*.pdf
75+
docs/build/epub/*.epub
76+
77+
release:
78+
needs: [package, documentation]
79+
if: startsWith(github.ref, 'refs/tags/')
80+
runs-on: ubuntu-latest
81+
environment: ${{ contains(github.ref, '-') && 'development' || 'production' }}
82+
steps:
83+
- uses: actions/checkout@v4
84+
- uses: actions/download-artifact@v4
85+
with:
86+
path: .artifacts
87+
- uses: softprops/action-gh-release@v2
88+
with:
89+
files: |
90+
.artifacts/package/**.whl
91+
.artifacts/documentation/latex/reticulumnetworkstack.pdf
92+
.artifacts/documentation/epub/ReticulumNetworkStack.epub
93+
draft: true
94+
generate_release_notes: true
95+
prerelease: ${{ contains(github.ref, '-') }}
96+
fail_on_unmatched_files: true

.github/workflows/python-app.yml

-28
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Reticulum Network Stack β <img align="right" src="https://static.pepy.tech/personalized-badge/rns?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Installs" style="padding-left:10px"/><a href="https://github.com/markqvist/reticulum/actions/workflows/python-app.yml"><img align="right" src="https://github.com/markqvist/reticulum/actions/workflows/python-app.yml/badge.svg"/></a>
1+
Reticulum Network Stack β <img align="right" src="https://static.pepy.tech/personalized-badge/rns?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Installs" style="padding-left:10px"/><a href="https://github.com/markqvist/Reticulum/actions/workflows/build.yml"><img align="right" src="https://github.com/markqvist/Reticulum/actions/workflows/build.yml/badge.svg"/></a>
22
==========
33

44
<p align="center"><img width="200" src="https://raw.githubusercontent.com/markqvist/Reticulum/master/docs/source/graphics/rns_logo_512.png"></p>

0 commit comments

Comments
 (0)