Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eb98658
chore: delete archives folder
RenanMsV Apr 15, 2026
5333089
chore: remove nasal_api_doc.py
RenanMsV Apr 15, 2026
7058196
chore: update gitignore
RenanMsV Apr 27, 2026
28e9dc3
chore: update README
RenanMsV Apr 27, 2026
b69682c
feat: converted into a package, uses Jinja2
RenanMsV Apr 27, 2026
1d3ebec
chore: add pylint and flake8 configs
RenanMsV Apr 27, 2026
d0b3a97
feat: add scripts to download latest Nasal from GitLab
RenanMsV Apr 27, 2026
2be2ae0
chore: add CHANGELOG.md
RenanMsV Apr 27, 2026
ca6241f
chore: bump version to 0.2.0
RenanMsV Apr 27, 2026
ecd6531
Merge pull request #1 from RenanMsV/refactor/package
RenanMsV Apr 27, 2026
dcc0e7d
chore: add pytest dependency
RenanMsV Apr 27, 2026
69fd896
feature: testing with pytest, GH actions
RenanMsV Apr 27, 2026
098ba2f
build: restrict push trigger to dev branch
RenanMsV Apr 27, 2026
c7293ea
build: test actions/checkout@v6
RenanMsV Apr 27, 2026
3b5df38
build: edit workflow name
RenanMsV Apr 27, 2026
d3272db
chore: add VSCode tasks.json
RenanMsV Apr 27, 2026
2d90ba2
ops: add VSCode launch.json to debug
RenanMsV Apr 27, 2026
6aa4064
Merge pull request #2 from RenanMsV/feature/tests
RenanMsV Apr 27, 2026
91baf85
chore: add dist folder to gitignore
RenanMsV Apr 28, 2026
21f687b
build: remove dev dependency 'pytest'
RenanMsV Apr 29, 2026
491de25
ci: install pytest before testing
RenanMsV Apr 29, 2026
62b64e0
ci: test on python 3.13
RenanMsV Apr 29, 2026
5003996
ci: add on-release workflow that will deploy to PyPI
RenanMsV Apr 29, 2026
1fd5c96
Merge pull request #4 from RenanMsV/build/deploy-pypi
RenanMsV Apr 29, 2026
a325431
build: restrict the branch where this workflow can run
RenanMsV Apr 29, 2026
2355857
Merge pull request #5 from RenanMsV/build/on-release-restrict
RenanMsV Apr 29, 2026
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
79 changes: 79 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: On Release

on:
workflow_dispatch: # allows manual trigger
release:
types:
- released
- prereleased

jobs:
build-and-deploy:
if: github.event.release.target_commitish == 'main'
runs-on: ubuntu-latest
environment: release
env:
VERSION: ${{ github.event.release.tag_name }}
PACKAGE_NAME: 'nasal_api_docs'
PACKAGE_COMMAND: 'nasal-api-docs -h'
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Package wheel
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade wheel build twine
python -m build .

FILE_WHL="dist/${PACKAGE_NAME}-${VERSION}-py3-none-any.whl"
FILE_TARGZ="dist/${PACKAGE_NAME}-${VERSION}.tar.gz"

# check files exists (quoted to be safe)
[ -f "$FILE_WHL" ] || { echo "Wheel not found: $FILE_WHL"; exit 1; }
[ -f "$FILE_TARGZ" ] || { echo "Tarball not found: $FILE_TARGZ"; exit 1; }

echo "FILE_WHL=$FILE_WHL" >> "$GITHUB_ENV"
echo "FILE_TARGZ=$FILE_TARGZ" >> "$GITHUB_ENV"
echo "Packaged app version: $VERSION at $FILE_WHL"

- name: Test local installation
run: |
python -m pip install --upgrade --force-reinstall "$FILE_WHL"
$PACKAGE_COMMAND

- name: Publish to TestPyPI
if: github.event.release.prerelease == true
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: python -m twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*

- name: Test install from TestPyPI
if: github.event.release.prerelease == true
run: |
python -m pip uninstall -y ${PACKAGE_NAME} || true

for i in {1..5}; do
python -m pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
"${PACKAGE_NAME}==${VERSION}" && break

echo "Waiting for package to appear on TestPyPI..."
sleep 5
done

$PACKAGE_COMMAND

- name: Publish to real PyPI
if: github.event.release.prerelease == false
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: python -m twine upload --verbose dist/*
29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint and Test

on:
pull_request:
push:
branches: [dev]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install flake8 pylint pytest

- run: flake8 nasal_api_docs --config setup.cfg
- run: pylint --rcfile setup.cfg nasal_api_docs
- run: pytest
Loading