mirror of
https://github.com/fmtr/haco.git
synced 2026-10-26 19:01:51 -04:00
Restructure v0 in v0 sub package
This commit is contained in:
parent
e6ea78ab49
commit
995cb81253
48 changed files with 25 additions and 20 deletions
92
.github/workflows/main.yml
vendored
92
.github/workflows/main.yml
vendored
|
|
@ -1,92 +0,0 @@
|
|||
name: Version and Deploy
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version'
|
||||
required: true
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
VERSION: ${{ github.event.inputs.version }}
|
||||
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
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
||||
- name: Install Tools
|
||||
run: |
|
||||
pip install twine tappack
|
||||
|
||||
- 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:
|
||||
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
|
||||
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
|
||||
git tag -a v${VERSION} -m "Release version ${VERSION}"
|
||||
git checkout --track origin/release
|
||||
git rebase main
|
||||
git push --follow-tags
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: haco.tapp
|
||||
tag_name: v${{ github.event.inputs.version }}
|
||||
generate_release_notes: true
|
||||
|
||||
- name: Build Wheel
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
|
||||
- name: Push Wheel
|
||||
env:
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||
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}
|
||||
Loading…
Add table
Add a link
Reference in a new issue