Compare commits
3 Commits
c9dc7fb270
...
a05332ba66
Author | SHA1 | Date | |
---|---|---|---|
a05332ba66 | |||
9703aba83b | |||
ec6d5fd2a2 |
@ -27,12 +27,12 @@ jobs:
|
||||
fi
|
||||
echo "::notice title=GOTIME::$GOTIME"
|
||||
# Set the output named "version_changed"
|
||||
echo "version_changed=$GOTIME" >> $GITHUB_OUTPUT
|
||||
echo "version_changed=$GOTIME" >> $GITEA_OUTPUT
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ check_for_changed_version ]
|
||||
if: needs.check_for_changed_version.outputs.version_changed == 'True'
|
||||
# needs: [ check_for_changed_version ]
|
||||
# if: needs.check_for_changed_version.outputs.version_changed == 'True'
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
@ -47,7 +47,7 @@ jobs:
|
||||
pip install shiv
|
||||
pip install poetry
|
||||
- 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
|
||||
run: |
|
||||
sed -i -e "s/?????/${{ env.VERSION }}/g" src/__init__.py
|
||||
@ -64,14 +64,14 @@ jobs:
|
||||
)
|
||||
echo """release_id=$(\
|
||||
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 'Content-Type: application/json' \
|
||||
-d "$JSON_DATA" \
|
||||
| python3 -c "import sys, json; print(json.load(sys.stdin)['id'])"\
|
||||
)""" >> $GITHUB_ENV
|
||||
)""" >> $GITEA_ENV
|
||||
- name: Upload assets!
|
||||
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 }}" \
|
||||
-F attachment=@utils
|
11
src/cli.py
11
src/cli.py
@ -48,6 +48,15 @@ def 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()
|
||||
@click.argument("dice")
|
||||
def roll(dice: str):
|
||||
@ -120,7 +129,7 @@ def update_from_gitea():
|
||||
if release_data["tag_name"] == src.__version__:
|
||||
status.stop()
|
||||
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
|
||||
status.update("Updating...")
|
||||
|
Loading…
Reference in New Issue
Block a user