Compare commits

..

1 Commits

17 changed files with 13 additions and 336 deletions

View File

@ -1,67 +0,0 @@
name: Get Changelog
on:
workflow_call:
outputs:
release_name:
description: "Name of the created release"
value: ${{ jobs.get_next_release.outputs.release_name }}
changelog:
description: "Release changelog"
value: ${{ jobs.get_next_release.outputs.clean_changelog }}
jobs:
get_next_release:
name: Get Next Release
runs-on: ubuntu-latest
outputs:
release_name: ${{ steps.get_next_version.outputs.tag }}
# changelog: ${{ steps.get_next_version.outputs.changelog }}
clean_changelog: ${{ steps.get_next_version.outputs.clean_changelog }}
steps:
- name: Check out repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Changes since last tag
id: changes
run: |
rm -f .changes
git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline >> .changes
cat .changes
- name: Check for changes
run: |
if [[ -z $(grep '[^[:space:]]' .changes) ]] ; then
echo "changes=false"
echo "changes=false" >> "$GITEA_OUTPUT"
else
echo "changes=true"
echo "changes=true" >> "$GITEA_OUTPUT"
fi
- name: Cancel if no changes
if: steps.changes.outputs.changes == 'false'
run: exit 1
- name: Set server URL
id: set_srvurl
run: |
SRVURL=$(echo "${{ gitea.server_url }}" | sed 's/https:\/\/\(.*\)/\1/')
echo "srvurl=$SRVURL" >> "$GITEA_OUTPUT"
- name: Get next version
uses: TriPSs/conventional-changelog-action@v6
id: get_next_version
with:
git-url: ${{ steps.set_srvurl.outputs.srvurl }}
github-token: ${{ gitea.token }}
preset: "conventionalcommits"
# preset: "angular" # This is the default
skip-commit: true
release-count: 1
output-file: false
create-summary: true
skip-on-empty: true
skip-version-file: true
skip-tag: true

View File

@ -24,7 +24,7 @@ jobs:
no-fail: true
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -66,7 +66,7 @@ jobs:
sed -i 's@${{ gitea.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -57,7 +57,7 @@ jobs:
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -63,7 +63,7 @@ jobs:
run: uv cache prune --ci
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -58,7 +58,7 @@ jobs:
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -51,7 +51,7 @@ jobs:
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -1,24 +0,0 @@
name: Create Gitea Release Pre-Existing Tag
on:
workflow_call:
inputs:
tag:
required: true
body:
required: false
secrets:
ACTIONS_TOKEN:
required: true
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create release
uses: https://git.tainton.uk/actions/create-release-action@v1.1.0
with:
release_name: ${{ inputs.tag }}
tag: ${{ inputs.tag }}
body: ${{ inputs.body }}
token: ${{ secrets.ACTIONS_TOKEN }}

View File

@ -1,96 +0,0 @@
name: Docker Compose Deploy Stack
on:
workflow_call:
secrets:
DEPLOY_HOST:
required: true
type: string
DEPLOY_USERNAME:
required: true
type: string
DEPLOY_SSHKEY:
required: true
type: string
DEPLOY_PORT:
required: true
type: string
PUSHOVER_USER_TOKEN:
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: "[ON RUNNER] Notify Build Start"
uses: https://git.tainton.uk/actions/pushover-action@v1.1.3
env:
PUSHOVER_APP_TOKEN: ${{ secrets.PUSHOVER_APP_TOKEN }}
PUSHOVER_USER_TOKEN: ${{ secrets.PUSHOVER_USER_TOKEN }}
with:
message: "Deploying stack ${{ gitea.repository }}"
title: 'Stack Deployment Started'
url: "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
url_title: 'View Logs'
- name: "[ON RUNNER] Checkout the repo"
uses: actions/checkout@v4
- name: "[ON RUNNER] Set project variables"
run: |
projectname="${{ gitea.event.repository.name }}"
echo "project_name=$projectname" >> $GITEA_ENV
echo "project_folder=/home/${{ secrets.DEPLOY_USERNAME }}/$projectname" >> $GITEA_ENV
- name: "[ON RUNNER] Create env file"
run: |
rm -f ".env"
touch ".env"
echo "$ALLVARS" | jq -r '. | to_entries[] | select(.key | startswith("DC_")) | .key + "=" + .value' >> ".env"
echo "$ALLSECRETS" | jq -r '. | to_entries[] | select(.key | startswith("DC_")) | .key + "=" + .value' >> ".env"
env:
ALLVARS: ${{ toJSON(vars) }}
ALLSECRETS: ${{ toJSON(secrets) }}
- name: "[ON HOST] Make directory if not exists"
uses: appleboy/ssh-action@v1.2.2
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSHKEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
mkdir -p ${{ env.project_folder }}
- name: "[ON HOST] SCP files to host"
uses: appleboy/scp-action@v1.0.0
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
port: ${{ secrets.DEPLOY_PORT }}
key: ${{ secrets.DEPLOY_SSHKEY }}
source: "./compose.yaml,./.env"
target: "${{ env.project_folder }}/"
- name: "[ON HOST] Deploy Stack"
uses: appleboy/ssh-action@v1.2.2
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSHKEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
cd ${{ env.project_folder }}
docker compose --env-file .env up --detach
- name: "[ON RUNNER] Notify Build End"
uses: https://git.tainton.uk/actions/pushover-action@v1.1.3
env:
PUSHOVER_APP_TOKEN: ${{ secrets.PUSHOVER_APP_TOKEN }}
PUSHOVER_USER_TOKEN: ${{ secrets.PUSHOVER_USER_TOKEN }}
with:
message: "Deployed stack ${{ gitea.repository }}"
title: 'Stack Deployment ${{ job.status }}'
url: "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
url_title: 'View Logs'

View File

@ -1,65 +0,0 @@
name: Docker Compose Remove Stack
on:
workflow_call:
secrets:
DEPLOY_HOST:
required: true
type: string
DEPLOY_USERNAME:
required: true
type: string
DEPLOY_SSHKEY:
required: true
type: string
DEPLOY_PORT:
required: true
type: string
PUSHOVER_USER_TOKEN:
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: "[ON RUNNER] Notify Build Start"
uses: https://git.tainton.uk/actions/pushover-action@v1.1.3
env:
PUSHOVER_APP_TOKEN: ${{ secrets.PUSHOVER_APP_TOKEN }}
PUSHOVER_USER_TOKEN: ${{ secrets.PUSHOVER_USER_TOKEN }}
with:
message: "Removing stack ${{ gitea.repository }}"
title: 'Stack Removal Started'
url: "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
url_title: 'View Logs'
- name: "[ON RUNNER] Set project variables"
run: |
projectname="${{ gitea.event.repository.name }}"
echo "project_name=$projectname" >> $GITEA_ENV
echo "project_folder=/home/${{ secrets.DEPLOY_USERNAME }}/$projectname" >> $GITEA_ENV
- name: "[ON HOST] Remove Stack"
uses: appleboy/ssh-action@v1.2.2
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSHKEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
cd ${{ env.project_folder }}
docker compose --env-file .env down
cd ..
rm -rf ${{ env.project_folder }}
- name: "[ON RUNNER] Notify Build End"
uses: https://git.tainton.uk/actions/pushover-action@v1.1.3
env:
PUSHOVER_APP_TOKEN: ${{ secrets.PUSHOVER_APP_TOKEN }}
PUSHOVER_USER_TOKEN: ${{ secrets.PUSHOVER_USER_TOKEN }}
with:
message: "Removed stack ${{ gitea.repository }}"
title: 'Stack Removal ${{ job.status }}'
url: "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
url_title: 'View Logs'

View File

@ -1,71 +0,0 @@
name: Release w/ Tag
on:
workflow_call:
outputs:
tag_name:
description: "Tag name"
value: ${{ jobs.get_next_release.outputs.release_name }}
changelog:
description: "Changelog"
value: ${{ jobs.get_next_release.outputs.clean_changelog }}
jobs:
get_next_release:
name: Get Next Release
runs-on: ubuntu-latest
outputs:
release_name: ${{ steps.get_next_version.outputs.tag }}
# changelog: ${{ steps.get_next_version.outputs.changelog }}
clean_changelog: ${{ steps.get_next_version.outputs.clean_changelog }}
steps:
- name: Check out repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Changes since last tag
id: changes
run: |
rm -f .changes
git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline >> .changes
cat .changes
- name: Check for changes
run: |
if [[ -z $(grep '[^[:space:]]' .changes) ]] ; then
echo "changes=false"
echo "changes=false" >> "$GITEA_OUTPUT"
else
echo "changes=true"
echo "changes=true" >> "$GITEA_OUTPUT"
fi
- name: Cancel if no changes
if: steps.changes.outputs.changes == 'false'
run: exit 1
- name: Set server URL
id: set_srvurl
run: |
SRVURL=$(echo "${{ gitea.server_url }}" | sed 's/https:\/\/\(.*\)/\1/')
echo "srvurl=$SRVURL" >> "$GITEA_OUTPUT"
- name: Get next version
uses: TriPSs/conventional-changelog-action@v6
id: get_next_version
with:
git-url: ${{ steps.set_srvurl.outputs.srvurl }}
github-token: ${{ gitea.token }}
preset: "conventionalcommits"
# preset: "angular" # This is the default
skip-commit: true
release-count: 1
output-file: false
create-summary: true
skip-on-empty: true
skip-version-file: true
skip-tag: false
- name: Cancel if no changelog
if: steps.get_next_version.outputs.skipped == 'true'
run: exit 1

View File

@ -22,7 +22,7 @@ jobs:
format: sonarqube
no-fail: true
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -49,7 +49,7 @@ jobs:
poetry run coverage xml
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -41,7 +41,7 @@ jobs:
poetry run coverage xml
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -50,7 +50,7 @@ jobs:
coverage xml
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -44,7 +44,7 @@ jobs:
coverage xml
sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v5.3.0
uses: SonarSource/sonarqube-scan-action@v5.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -7,8 +7,8 @@
],
"platformCommit": "enabled",
"dependencyDashboardAutoclose": true,
"assignAutomerge": false,
"assigneesFromCodeOwners": false,
"assignAutomerge": true,
"assigneesFromCodeOwners": true,
"rebaseWhen": "behind-base-branch",
"rollbackPrs": true,
"labels": [