8b3a40e7a4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
121 lines
3.4 KiB
YAML
121 lines
3.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
pull_request:
|
|
branches-ignore: ['*']
|
|
push:
|
|
branches:
|
|
- next
|
|
- next-major
|
|
- beta
|
|
- alpha
|
|
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
php-version: '8.3'
|
|
build-node-version: 22
|
|
|
|
jobs:
|
|
####################
|
|
# Semantic release
|
|
####################
|
|
semantic:
|
|
if: github.event_name != 'pull_request'
|
|
uses: monicahq/workflows/.github/workflows/release.yml@v2
|
|
with:
|
|
semantic_version: 23
|
|
secrets:
|
|
GH_TOKEN_RELEASE: ${{ secrets.GH_TOKEN_RELEASE }}
|
|
|
|
package:
|
|
needs: semantic
|
|
runs-on: ubuntu-latest
|
|
name: Package release
|
|
if: needs.semantic.outputs.new_release_published == 'true'
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: v${{ needs.semantic.outputs.new_release_version }}
|
|
- name: Download changelog file
|
|
uses: actions/download-artifact@v5
|
|
with:
|
|
name: changelog
|
|
|
|
- name: Setup PHP ${{ env.php-version }}
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ env.php-version }}
|
|
coverage: none
|
|
|
|
# Composer
|
|
- name: Get Composer Cache Directory
|
|
id: composer-cache
|
|
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
|
- name: Cache composer files
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-composer-${{ env.php-version }}-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-composer-${{ env.php-version }}-${{ hashFiles('**/composer.lock') }}
|
|
${{ runner.os }}-composer-${{ env.php-version }}
|
|
${{ runner.os }}-composer-
|
|
|
|
# Yarn
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ env.build-node-version }}
|
|
cache: yarn
|
|
|
|
- name: Import key
|
|
run: echo -e "$GPG_KEY" | gpg --batch --yes --import -
|
|
env:
|
|
GPG_KEY: ${{ secrets.GPG_KEY }}
|
|
|
|
- name: Create package
|
|
id: package
|
|
run: scripts/ci/package.sh 'v${{ needs.semantic.outputs.new_release_version }}' $GITHUB_SHA
|
|
env:
|
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
|
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
|
|
|
|
- name: Publish package
|
|
run: |
|
|
for f in {${{ steps.package.outputs.package }},${{ steps.package.outputs.assets }}}{,.asc,.sha512,.sha512.asc}; do
|
|
echo "Uploading release file '$f'…"
|
|
gh release upload 'v${{ needs.semantic.outputs.new_release_version }}' "$f" --clobber
|
|
done
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Store package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: package
|
|
path: ${{ steps.package.outputs.package }}
|
|
|
|
- name: Store assets
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: assets
|
|
path: ${{ steps.package.outputs.assets }}
|
|
|
|
docker-workflow:
|
|
needs: [semantic, package]
|
|
runs-on: ubuntu-latest
|
|
name: Docker release create
|
|
if: needs.semantic.outputs.new_release_published == 'true'
|
|
|
|
steps:
|
|
- name: Dispatch docker release
|
|
uses: benc-uk/workflow-dispatch@v1
|
|
with:
|
|
workflow: Release update
|
|
repo: monicahq/docker
|
|
ref: refs/heads/main
|
|
token: ${{ secrets.DOCKER_GITHUB_TOKEN }}
|