Bump symfony/validator from 5.4.41 to 5.4.43 #246
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: Deploy | |
on: | |
push: | |
branches: | |
- 'develop' | |
paths: | |
- "bin/**" | |
- "config.yaml" | |
- "composer.json" | |
- "composer.lock" | |
- "res/**" | |
- "scoper.inc.php" | |
- "src/**" | |
- "version.txt" | |
tags: | |
# only tags with semver format | |
- '[0-9]+.[0-9]+.[0-9]+' | |
workflow_dispatch: | |
jobs: | |
create-signed-phar-file: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout HEAD | |
uses: actions/[email protected] | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
tools: composer:2 | |
php-version: '7.4' | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Create phar | |
run: bash ./build.sh | |
- name: Run phar file | |
run: php n98-magerun2.phar --version | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
trust_level: 5 | |
- name: GPG sign phar file (detached) | |
run: | | |
echo "${{ secrets.GPG_PASSPHRASE }}" | \ | |
gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --detach-sign -a \ | |
-o n98-magerun2.phar.asc n98-magerun2.phar | |
env: | |
GPG_TTY: $(tty) | |
- name: GPG verify phar file | |
run: gpg --verify n98-magerun2.phar.asc n98-magerun2.phar | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: n98-magerun2.phar | |
path: | | |
n98-magerun2.phar | |
n98-magerun2.phar.asc | |
update-files-magerun-net: | |
runs-on: ubuntu-latest | |
needs: ["create-signed-phar-file"] | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: n98-magerun2.phar | |
path: . | |
- name: rename phar file (develop / unstable) | |
if: github.ref == 'refs/heads/develop' | |
run: | | |
mv n98-magerun2.phar n98-magerun2-dev.phar | |
mv n98-magerun2.phar.asc n98-magerun2-dev.phar.asc | |
ls -l | |
- name: rename phar file (tag) | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
# Get tag part of github.ref | |
TAG=$(cut -d'/' -f3 <<< "$GITHUB_REF") | |
LATEST_VERSION=$(curl -s https://raw.githubusercontent.com/netz98/n98-magerun2/master/version.txt | tr -d '[:space:]') | |
# Check if curl was successful | |
if [[ -z "$LATEST_VERSION" ]]; then | |
echo "Failed to fetch the latest version." | |
exit 1 | |
fi | |
# Rename files | |
cp "n98-magerun2.phar" "n98-magerun2-${TAG}.phar" | |
cp "n98-magerun2.phar.asc" "n98-magerun2-${TAG}.phar.asc" | |
mv "n98-magerun2.phar" "n98-magerun2-latest.phar" | |
mv "n98-magerun2.phar.asc" "n98-magerun2-latest.phar.asc" | |
# List files to verify | |
ls -l | |
- name: Upload phar file to files.magerun.net | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.SSH_DEPLOY_HOST }} | |
username: ${{ secrets.SSH_DEPLOY_USERNAME }} | |
key: ${{ secrets.SSH_DEPLOY_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SSH_DEPLOY_PASSPHRASE }} | |
source: '*.phar,*.phar.asc' | |
target: ${{ secrets.SSH_DEPLOY_TARGET }} | |
rm: false | |
overwrite: true | |
- name: Run update tasks on files.magerun.net | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_DEPLOY_HOST }} | |
username: ${{ secrets.SSH_DEPLOY_USERNAME }} | |
key: ${{ secrets.SSH_DEPLOY_PRIVATE_KEY }} | |
passphrase: ${{ secrets.SSH_DEPLOY_PASSPHRASE }} | |
script: | | |
build/build_phive.sh | |
curl -s https://files.magerun.net/list.php > public/index.html | |
- name: Invalidate cloudflare | |
run: | | |
curl -X POST 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache' \ | |
-H 'Content-Type:application/json' \ | |
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_TOKEN }}" \ | |
--data-raw '{"purge_everything":true}' | |
update-dist-repo: | |
runs-on: ubuntu-latest | |
needs: [ "create-signed-phar-file" ] | |
steps: | |
- name: Checkout HEAD | |
uses: actions/[email protected] | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.DIST_REPO_DEPLOY_KEY }} | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: n98-magerun2.phar | |
- name: Update dist repo | |
env: | |
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} | |
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }} | |
run: bash .github/workflows/update-dist-repo.sh | |
create-github-release: | |
runs-on: ubuntu-latest | |
needs: [ "create-signed-phar-file" ] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout HEAD | |
uses: actions/[email protected] | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: n98-magerun2.phar | |
- name: 'Build Changelog' | |
uses: mikepenz/release-changelog-builder-action@v5 | |
with: | |
owner: "netz98" | |
repo: "n98-magerun2" | |
id: build_changelog | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: echo "${{ steps.build_changelog.outputs.changelog }}" | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: ${{steps.build_changelog.outputs.changelog}} | |
files: | | |
n98-magerun2.phar | |
n98-magerun2.phar.asc |