-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start with a minimal approach for releases based on action version string of current branch/tag
- Loading branch information
Showing
1 changed file
with
9 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,26 @@ | ||
name: PyPI release | ||
|
||
# This workflow build and upload a pre-release package to test.pypi.org | ||
# The version is postfixed with .devYYYYMMDDHHMM, allowing to upload each minute. | ||
# This workflow is run each day at 23:59 UTC, or on demand. | ||
# When run on schedule, a new package is generated only if latest commit is less than 1 day. | ||
# | ||
# Note : a scheduled workflow must be on the default branch to be executed. | ||
# | ||
|
||
on: | ||
workflow_dispatch: | ||
# schedule: | ||
# - cron: '59 23 * * *' | ||
on: workflow_dispatch | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
should_run: true | ||
|
||
release: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: dev | ||
- name: print latest_commit | ||
run: git log -n 1 | ||
- name: check latest commit is less than a day | ||
if: ${{ github.event_name == 'schedule' }} | ||
run: test -z "$(git log -n 1 --after='24 hours')" && echo "should_run=false" >> $GITHUB_ENV ; true | ||
- name: Set up Python | ||
if: ${{ env.should_run != 'false' }} | ||
uses: actions/setup-python@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
check-latest: true | ||
- name: Install dependencies | ||
if: ${{ env.should_run != 'false' }} | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U build twine wheel | ||
- name: build dev version | ||
if: ${{ env.should_run != 'false' }} | ||
run: sed -i "s/\"$/.dev$(date +%Y%m%d%H%M)\"/" motioneye/__init__.py | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade build twine | ||
- name: Build package | ||
if: ${{ env.should_run != 'false' }} | ||
run: python -m build | ||
- name: Publish package | ||
if: ${{ env.should_run != 'false' }} | ||
# run: twine upload --repository testpypi -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} dist/* | ||
run: twine upload --repository pypi -u __token__ -p ${{ secrets.PYPI_TOKEN }} dist/* | ||
run: twine upload -r testpypi -u '__token__' -p '${{ secrets.TEST_PYPI_API_TOKEN }}' dist/* | ||
#run: twine upload -r pypi -u '__token__' -p '${{ secrets.PYPI_TOKEN }}' dist/* | ||
|