|
| 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 |
0 commit comments