2021-01-20 19:13:53 -05:00
|
|
|
name: Build Pip package
|
2020-11-28 05:44:37 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-10-19 19:20:43 -04:00
|
|
|
runs-on: ubuntu-22.04
|
2020-11-28 05:44:37 -05:00
|
|
|
|
2023-11-03 22:12:19 -04:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
|
2020-11-28 05:44:37 -05:00
|
|
|
steps:
|
2023-11-03 22:12:19 -04:00
|
|
|
- uses: actions/checkout@v4
|
2020-11-28 05:44:37 -05:00
|
|
|
with:
|
2020-11-28 05:48:45 -05:00
|
|
|
submodules: true
|
2020-11-28 05:44:37 -05:00
|
|
|
fetch-depth: 1
|
|
|
|
|
|
|
|
- name: Set up Python
|
2023-11-03 22:12:19 -04:00
|
|
|
uses: actions/setup-python@v4
|
2020-11-28 05:44:37 -05:00
|
|
|
with:
|
2023-10-19 19:20:43 -04:00
|
|
|
python-version: 3.11
|
2020-11-28 05:44:37 -05:00
|
|
|
architecture: x64
|
|
|
|
|
2023-11-03 22:12:19 -04:00
|
|
|
- uses: pdm-project/setup-pdm@v3
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pdm install --fail-fast --no-lock --group :all --no-self
|
|
|
|
|
|
|
|
- name: Build package
|
2020-11-28 05:44:37 -05:00
|
|
|
run: |
|
2023-11-03 22:12:19 -04:00
|
|
|
rm ./dist/archivebox-*.whl
|
|
|
|
pdm build
|
|
|
|
|
|
|
|
- name: Install from build
|
|
|
|
run: pip install ./dist/archivebox-*.whl
|
2020-11-28 05:44:37 -05:00
|
|
|
|
|
|
|
- name: Add some links to test
|
|
|
|
run: |
|
|
|
|
mkdir data && cd data
|
|
|
|
archivebox init
|
|
|
|
archivebox add 'https://example.com'
|
|
|
|
archivebox version
|
|
|
|
archivebox status
|
|
|
|
|
2023-11-03 22:12:19 -04:00
|
|
|
- name: Publish package distributions to PyPI
|
|
|
|
run: pdm publish --no-build
|
|
|
|
|
2021-04-13 03:59:44 -04:00
|
|
|
# - name: Push build to PyPI
|
|
|
|
# run: |
|
|
|
|
# cd pip_dist/
|
|
|
|
# python3 -m twine upload --repository testpypi pip_dist/*.{whl,tar.gz}
|
|
|
|
# python3 -m twine upload --repository pypi pip_dist/*.{whl,tar.gz}
|
|
|
|
|
2020-12-11 14:26:37 -05:00
|
|
|
# - name: Commit built package
|
2020-12-11 12:09:40 -05:00
|
|
|
# run: |
|
|
|
|
# cd pip_dist/
|
|
|
|
# git config --local user.email "action@github.com"
|
|
|
|
# git config --local user.name "GitHub Action"
|
|
|
|
# git commit -m "Pip package autobuild" -a
|
|
|
|
|
2020-12-11 14:26:37 -05:00
|
|
|
# - name: Push build to Github
|
2020-12-11 12:09:40 -05:00
|
|
|
# uses: ad-m/github-push-action@master
|
|
|
|
# with:
|
|
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# repository: ArchiveBox/pip-archivebox
|
|
|
|
# branch: ${{ github.ref }}
|
|
|
|
# directory: pip_dist
|
|
|
|
|