From c75d5aa446b4659c9da31915d93438f962a352ef Mon Sep 17 00:00:00 2001 From: Edward Brown Date: Fri, 21 Nov 2025 11:15:37 +0000 Subject: [PATCH] Update Actions and set pre-release --- haco/.github/workflows/main.yml | 56 +++++++++------------------------ haco/version | 2 +- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/haco/.github/workflows/main.yml b/haco/.github/workflows/main.yml index c85e74f..8e75948 100644 --- a/haco/.github/workflows/main.yml +++ b/haco/.github/workflows/main.yml @@ -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} \ No newline at end of file diff --git a/haco/version b/haco/version index 6c6aa7c..7b7a560 100644 --- a/haco/version +++ b/haco/version @@ -1 +1 @@ -0.1.0 \ No newline at end of file +0.1.0a1 \ No newline at end of file