2024-11-23 14:19:29 +00:00
|
|
|
name: Create tag
|
2024-11-20 20:44:07 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- release
|
|
|
|
|
|
|
|
jobs:
|
2024-11-23 14:19:29 +00:00
|
|
|
build:
|
|
|
|
uses: ./.gitea/workflows/common_build.yml
|
2024-11-20 20:44:07 +00:00
|
|
|
createTagAndChangelog:
|
|
|
|
runs-on: ubuntu-latest
|
2024-11-23 14:19:29 +00:00
|
|
|
needs: build
|
2024-11-20 20:44:07 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2024-11-23 14:19:29 +00:00
|
|
|
persist-credentials: false
|
|
|
|
- name: Config git
|
|
|
|
run: |
|
|
|
|
git config --global user.email aminecmi+gitea@pm.me
|
|
|
|
git config --global user.name Gitea
|
2024-11-20 20:44:07 +00:00
|
|
|
- name: Creating the tag
|
|
|
|
run: |
|
|
|
|
git fetch --tags -p
|
|
|
|
PREV=$(git describe --tags --abbrev=0)
|
|
|
|
./build.sh --publish --from-ci
|
|
|
|
- name: Generating changelog
|
|
|
|
run: |
|
|
|
|
VER=$(git describe --tags --abbrev=0)
|
|
|
|
CHANGELOG=$(git log $PREV..HEAD --pretty="- %s")
|
|
|
|
echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
|
|
|
|
git add CHANGELOG.md
|
|
|
|
git commit -m "Changelog for $VER"
|
2024-11-23 14:19:29 +00:00
|
|
|
git push origin ${VER}
|
|
|
|
git push origin master
|
2024-11-20 20:44:07 +00:00
|
|
|
- name: copy file via ssh password
|
2024-11-23 14:19:29 +00:00
|
|
|
uses: garygrossgarten/github-action-scp@release
|
2024-11-20 20:44:07 +00:00
|
|
|
with:
|
|
|
|
host: amine-bouabdallaoui.fr
|
|
|
|
username: ubuntu
|
2024-11-23 14:19:29 +00:00
|
|
|
privateKey: ${{ secrets.PRIVATE_KEY }}
|
|
|
|
local: version.txt
|
|
|
|
target: /home/ubuntu/
|
2024-11-20 20:44:07 +00:00
|
|
|
- name: deploy version file
|
|
|
|
uses: appleboy/ssh-action@v1.2.0
|
|
|
|
with:
|
|
|
|
host: amine-bouabdallaoui.fr
|
|
|
|
username: ubuntu
|
|
|
|
key: ${{ secrets.PRIVATE_KEY }}
|
|
|
|
script: cd /home/ubuntu && sudo rm -rf /var/www/amine/version.txt && sudo chown www-data:www-data ./version.txt && sudo mv version.txt /var/www/amine/
|