Merge pull request #27 from Qwizi/Qwizi-patch-1 #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'scripts/**' | |
- 'nginx/**' | |
- '.github/**' | |
- 'docker-compose.prod.yml' | |
- 'docker-compose.yml' | |
- README.md | |
- .env.example | |
- .gitignore | |
jobs: | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4.1.1 | |
with: | |
token: ${{ secrets.RELEASE_GIT_TOKEN }} | |
- name: "Install Poetry" | |
run: "pipx install poetry" | |
- name: "Set up Python 3.11" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "3.11" | |
cache: "poetry" | |
- name: Update version in pyproject.toml | |
run: | | |
poetry version patch | |
- name: Update qwizii/sharkservers image version | |
run: | | |
sed -i "s/qwizii\/dealhub:.*$/qwizii\/dealhub:v$(poetry version -s)/" docker-compose.prod.yml | |
sed -i "s/qwizii\/dealhub:.*$/qwizii\/dealhub:v$(poetry version -s)/" coolify/docker-compose.yml | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "github@actions.com" | |
git config --global user.name "GitHub Actions " | |
git add . | |
if [[ -n "$(git diff --cached)" ]]; then | |
git commit -m "Dump version [skip ci]" | |
git push | |
else | |
echo "No changes to commit" | |
fi | |
- name: Extract version from pyproject.toml | |
id: extract_metadata | |
run: | | |
VERSION=$(awk -F ' = ' '/version =/ {gsub(/"/, "", $2); print $2}' ./pyproject.toml) | |
LABELS="version=$VERSION,latest" | |
echo "::set-output name=version::$VERSION" | |
echo "::set-output name=labels::$LABELS" | |
shell: /usr/bin/bash -e {0} | |
- name: Release New Version | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: v${{ steps.extract_metadata.outputs.version }} | |
tag_name: v${{ steps.extract_metadata.outputs.version }} | |
token: ${{ secrets.RELEASE_GIT_TOKEN }} |