diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index ee8755d..6fab9e6 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -12,8 +12,6 @@ jobs: contents: write steps: - uses: https://github.com/actions/checkout@v2 - - name: lsb_release -i -r -s - run: lsb_release -i -r -s - uses: https://github.com/actions/setup-python@v4 with: python-version: '3.11.x' @@ -29,11 +27,15 @@ jobs: run: | sed -i -e "s/?????/${{ env.CURRENT_TIME_VERSION }}/g" src/__init__.py make build - - uses: https://github.com/ncipollo/release-action@v1 - with: - artifacts: "utils" - body: "It's releasin' time" - generateReleaseNotes: false - tag: ${{ env.CURRENT_TIME_VERSION }} - commit: master - token: ${{ secrets.PAT }} + - name: UPLOAD! + run: | + echo """release_id=$(\ + curl -s https://git.joekaufeld.com/api/v1/repos/jkaufeld/utils/releases \ + -H "Authorization: token ${{ secrets.PAT }}" \ + -d tag_name=${{ env.CURRENT_TIME_VERSION }} \ + | python3 -c "import sys, json; print(json.load(sys.stdin)['id'])"\ + )""" >> $GITHUB_ENV + + curl https://git.joekaufeld.com/api/v1/repos/jkaufeld/utils/releases/${{ env.release_id }}/assets \ + -H "Authorization: token ${{ secrets.PAT }}" \ + -F attachment=@utils diff --git a/src/cli.py b/src/cli.py index 78d0d4b..b5cb78d 100644 --- a/src/cli.py +++ b/src/cli.py @@ -106,7 +106,7 @@ def update(): ) return release_data = response.json() - if release_data["name"] == src.__version__: + if release_data["tag_name"] == src.__version__: click.echo("Server version is the same as current version; nothing to update.") return