Update Actions and set pre-release

This commit is contained in:
Edward Brown 2025-11-21 11:15:37 +00:00 • committed by Edward Brown
parent 424ae0a8cb
commit c75d5aa446
2 changed files with 16 additions and 42 deletions

View file

@ -1,11 +1,10 @@
name: Version and Deploy
on:
push:
paths:
- 'haco/versionTEMP'
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
jobs:
@ -17,25 +16,24 @@ jobs:
NAME: ${{ github.event.repository.name }}
NAME_SHORT: ${{ github.event.repository.name }}
ORG: ${{ github.repository_owner }}
SHLINK_API_KEY: ${{ secrets.SHLINK_API_KEY }}
LINK_ID: haco/tapp
#SHLINK_API_KEY: ${{ secrets.SHLINK_API_KEY }}
#LINK_ID: haco/tapp
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Version Environment Variable
run: |
VERSION=$(cat ${PATH_VERSION})
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Install Tools
run: |
pip install twine tappack
pip install twine
pip install -U packaging setuptools twine pip build #https://github.com/pypa/twine/issues/1216
- name: Docker Login
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
run: |
echo $DOCKER_TOKEN | docker login --username $DOCKER_USER --password-stdin
- name: Increment Version
env:
@ -43,16 +41,7 @@ jobs:
run: |
git config --global user.name 'Frontmatter Actions'
git config --global user.email "$GIT_EMAIL"
echo -n ${VERSION} > ${NAME}/version
python3 update_version.py ${VERSION}
tappack --module-path berry/ --output ./${NAME_SHORT}.tapp
git add ${NAME}/version
git add berry/${NAME_SHORT}_version.be
git add ha/addon/config.yaml
git commit -am "Increment version number to ${VERSION} for release"
git push
VERSION=${{ env.VERSION }}
git tag -a v${VERSION} -m "Release version ${VERSION}"
git checkout --track origin/release
git rebase main
@ -61,13 +50,13 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
files: haco.tapp
tag_name: v${{ github.event.inputs.version }}
tag_name: v${{ env.VERSION }}
generate_release_notes: true
prerelease: true
- name: Build Wheel
run: |
python setup.py sdist bdist_wheel
python -m build
- name: Push Wheel
env:
@ -75,18 +64,3 @@ jobs:
TWINE_USERNAME: __token__
run: |
twine upload dist/*
- name: Update Link
run: |
URL=https://github.com/${ORG}/${NAME}/releases/download/v${VERSION}/${NAME_SHORT}.tapp
DATA="{\"longUrl\": \"${URL}\"}"
curl --request PATCH --url https://fmtr.link/rest/v3/short-urls/${LINK_ID} --header "Content-Type: application/json" --header "X-Api-Key: ${SHLINK_API_KEY}" --data "$DATA" &> /dev/null
- name: Build Docker
run: |
docker build . --build-arg TYPE=release --build-arg VERSION=${VERSION} --tag fmtr/${NAME}:v${VERSION}
docker tag fmtr/${NAME}:v${VERSION} fmtr/${NAME}:latest
- name: Push Docker
run: |
docker push --all-tags fmtr/${NAME}

View file

@ -1 +1 @@
0.1.0
0.1.0a1