Compare commits

..

3 Commits

Author SHA1 Message Date
a05332ba66 👷 change github -> gitea
Some checks failed
build
check_for_changed_version
2023-04-06 14:15:30 -04:00
9703aba83b 💚 gitea can't support "needs" yet. Will be fixed in next release 2023-04-06 14:13:51 -04:00
ec6d5fd2a2 add bson objectId 2023-04-06 14:12:48 -04:00
2 changed files with 17 additions and 8 deletions

View File

@ -27,12 +27,12 @@ jobs:
fi fi
echo "::notice title=GOTIME::$GOTIME" echo "::notice title=GOTIME::$GOTIME"
# Set the output named "version_changed" # Set the output named "version_changed"
echo "version_changed=$GOTIME" >> $GITHUB_OUTPUT echo "version_changed=$GOTIME" >> $GITEA_OUTPUT
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ check_for_changed_version ] # needs: [ check_for_changed_version ]
if: needs.check_for_changed_version.outputs.version_changed == 'True' # if: needs.check_for_changed_version.outputs.version_changed == 'True'
permissions: permissions:
contents: write contents: write
steps: steps:
@ -47,7 +47,7 @@ jobs:
pip install shiv pip install shiv
pip install poetry pip install poetry
- name: Add VERSION env property - name: Add VERSION env property
run: echo "VERSION=v$(poetry version | python -c 'import sys;print(sys.stdin.read().split()[1])')" >> $GITHUB_ENV run: echo "VERSION=v$(poetry version | python -c 'import sys;print(sys.stdin.read().split()[1])')" >> $GITEA_ENV
- name: Build the sucker - name: Build the sucker
run: | run: |
sed -i -e "s/?????/${{ env.VERSION }}/g" src/__init__.py sed -i -e "s/?????/${{ env.VERSION }}/g" src/__init__.py
@ -64,14 +64,14 @@ jobs:
) )
echo """release_id=$(\ echo """release_id=$(\
curl -X POST \ curl -X POST \
-s https://git.joekaufeld.com/api/v1/repos/${GITHUB_REPOSITORY%/*}/${{ github.event.repository.name }}/releases \ -s https://git.joekaufeld.com/api/v1/repos/${GITEA_REPOSITORY%/*}/${{ gitea.event.repository.name }}/releases \
-H "Authorization: token ${{ secrets.PAT }}" \ -H "Authorization: token ${{ secrets.PAT }}" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "$JSON_DATA" \ -d "$JSON_DATA" \
| python3 -c "import sys, json; print(json.load(sys.stdin)['id'])"\ | python3 -c "import sys, json; print(json.load(sys.stdin)['id'])"\
)""" >> $GITHUB_ENV )""" >> $GITEA_ENV
- name: Upload assets! - name: Upload assets!
run: | run: |
curl https://git.joekaufeld.com/api/v1/repos/${GITHUB_REPOSITORY%/*}/${{ github.event.repository.name }}/releases/${{ env.release_id }}/assets \ curl https://git.joekaufeld.com/api/v1/repos/${GITEA_REPOSITORY%/*}/${{ gitea.event.repository.name }}/releases/${{ env.release_id }}/assets \
-H "Authorization: token ${{ secrets.PAT }}" \ -H "Authorization: token ${{ secrets.PAT }}" \
-F attachment=@utils -F attachment=@utils

View File

@ -48,6 +48,15 @@ def uuid4():
click.echo(uuid.uuid4()) click.echo(uuid.uuid4())
@main.command()
def objectid():
"""Generate a random ObjectID."""
new_id = ''
for _ in range(24):
new_id += random.choice(string.ascii_lowercase[:6] + string.digits)
click.echo(new_id)
@main.command() @main.command()
@click.argument("dice") @click.argument("dice")
def roll(dice: str): def roll(dice: str):
@ -120,7 +129,7 @@ def update_from_gitea():
if release_data["tag_name"] == src.__version__: if release_data["tag_name"] == src.__version__:
status.stop() status.stop()
click.echo( click.echo(
"Server version is the same as current version;" " nothing to update." "Server version is the same as current version; nothing to update."
) )
return return
status.update("Updating...") status.update("Updating...")