CI and release cycle: release branches, tag, Packagist, sync, tests, audit, Trivy
This commit is contained in:
1 parent
f74ab3a94b
commit
302a1c699d
20 files changed
+1029
-9
No files matched your search
@@ -0,0 +1,90 @@
|
||||
name: Release
|
||||
|
||||
# A push to production is the merge of a release pull request. Check it once more, tag it, tell
|
||||
# Packagist, and bring develop up to date, so the next features start from what was released.
|
||||
on:
|
||||
push:
|
||||
branches: [production]
|
||||
|
||||
concurrency:
|
||||
group: release
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: webdevops/php:8.4
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: install dependencies
|
||||
run: composer update --prefer-stable --prefer-dist
|
||||
|
||||
- name: pest tests
|
||||
run: vendor/bin/pest
|
||||
|
||||
- name: composer audit
|
||||
run: composer audit
|
||||
|
||||
tag:
|
||||
runs-on: docker
|
||||
needs: verify
|
||||
container:
|
||||
image: webdevops/php:8.4
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: release
|
||||
run: |
|
||||
git config --global --add safe.directory "$(pwd)"
|
||||
python3 .gitea/scripts/release.py
|
||||
env:
|
||||
GT_URL: https://git.iriks.casa
|
||||
GT_OWNER: iriks-it
|
||||
GT_REPO: laravel-manager
|
||||
GT_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||
COMMIT_HASH: ${{ github.sha }}
|
||||
|
||||
# Needs the secrets PACKAGIST_USERNAME and PACKAGIST_TOKEN on the repository, and the package
|
||||
# submitted on packagist.org once. Without them this step only says so.
|
||||
packagist:
|
||||
runs-on: docker
|
||||
needs: tag
|
||||
container:
|
||||
image: python:3.12-alpine
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: tell Packagist
|
||||
run: python3 .gitea/scripts/packagist.py
|
||||
env:
|
||||
PACKAGIST_USERNAME: ${{ secrets.PACKAGIST_USERNAME }}
|
||||
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
|
||||
PACKAGE_URL: https://git.iriks.casa/iriks-it/laravel-manager
|
||||
|
||||
# Last: merge what was released into develop. Runs even when Packagist could not be told.
|
||||
sync-develop:
|
||||
runs-on: docker
|
||||
needs: [tag, packagist]
|
||||
if: always() && needs.tag.result == 'success'
|
||||
container:
|
||||
image: webdevops/php:8.4
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: sync develop
|
||||
run: python3 .gitea/scripts/sync_develop.py
|
||||
env:
|
||||
GT_URL: https://git.iriks.casa
|
||||
GT_OWNER: iriks-it
|
||||
GT_REPO: laravel-manager
|
||||
GT_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||
GT_BOT_USER: deploy-bot
|
||||
COMMIT_HASH: ${{ github.sha }}
|
||||
Reference in new issue
Block a user