generated from Templates/Python
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
e14dd122e7 | |||
d5344f95c1 | |||
48c2e3bc3f | |||
1b84f5064c | |||
5172bdabaf | |||
08860faa46 | |||
85e8e2fffd | |||
|
d0e18232a2 | ||
|
c50b1b588b | ||
|
694680ffdf |
@ -6,7 +6,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
# Sequence of patterns matched against refs/tags
|
# Sequence of patterns matched against refs/tags
|
||||||
tags:
|
tags:
|
||||||
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -30,23 +30,34 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
body_path: release_message.md
|
body_path: release_message.md
|
||||||
|
|
||||||
# deploy:
|
deploy:
|
||||||
# needs: release
|
needs: release
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# - uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
# - name: Set up Python
|
- name: Set up Python
|
||||||
# uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
# with:
|
with:
|
||||||
# python-version: '3.x'
|
python-version: '3.x'
|
||||||
# - name: Install dependencies
|
- name: Install dependencies
|
||||||
# run: |
|
run: |
|
||||||
# python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
# pip install setuptools wheel twine
|
pip install setuptools wheel twine
|
||||||
# - name: Build and publish
|
- name: Check version match
|
||||||
# env:
|
run: |
|
||||||
# TWINE_USERNAME: __token__
|
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')
|
||||||
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
if [ "$(cat $REPOSITORY_NAME/VERSION)" = "${GITHUB_REF_NAME:1}" ] ; then
|
||||||
# run: |
|
echo "Version matches successfully!"
|
||||||
# python setup.py sdist bdist_wheel
|
else
|
||||||
# twine upload dist/*
|
echo "Version must match!"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
- name: Build and publish
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: gitearobot
|
||||||
|
TWINE_PASSWORD: ${{ secrets.PACKAGE_GITEA_PAT }}
|
||||||
|
run: |
|
||||||
|
REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')
|
||||||
|
python setup.py sdist bdist_wheel
|
||||||
|
twine upload --repository-url https://git.disi.dev/api/packages/$REPOSITORY_OWNER/pypi dist/*
|
||||||
|
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
name: Rename the project from template
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
permissions: write-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rename-project:
|
|
||||||
if: ${{ !endsWith (github.repository, 'Templates/Python') }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
# by default, it uses a depth of 1
|
|
||||||
# this fetches all history so that we can read each commit
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: ${{ gitea.head_ref }}
|
|
||||||
|
|
||||||
- run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- run: echo "REPOSITORY_URLNAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}')" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- run: echo "REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Is this still a template
|
|
||||||
id: is_template
|
|
||||||
run: echo "::set-output name=is_template::$(ls .gitea/template.yml &> /dev/null && echo true || echo false)"
|
|
||||||
|
|
||||||
- name: Rename the project
|
|
||||||
if: steps.is_template.outputs.is_template == 'true'
|
|
||||||
run: |
|
|
||||||
echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}"
|
|
||||||
.gitea/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "Awesome ${{ env.REPOSITORY_NAME }} created by ${{ env.REPOSITORY_OWNER }}"
|
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
|
||||||
commit_message: "✅ Ready to clone and code."
|
|
||||||
# commit_options: '--amend --no-edit'
|
|
||||||
push_options: --force
|
|
@ -1 +1 @@
|
|||||||
0.1.0
|
0.2.9
|
||||||
|
Loading…
Reference in New Issue
Block a user