Skip to content

Bump friendsofphp/php-cs-fixer from 3.25.0 to 3.25.1 #28

Bump friendsofphp/php-cs-fixer from 3.25.0 to 3.25.1

Bump friendsofphp/php-cs-fixer from 3.25.0 to 3.25.1 #28

Workflow file for this run

---
name: Deploy
on:
push:
branches:
- develop
- deploy
tags:
# only tags with semver format
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
create-signed-phar-file:
runs-on: ubuntu-latest
steps:
- name: Checkout HEAD
uses: actions/[email protected]
# Allow only newer versions
- name: Collect versions
run: |
# extract tag part of github.ref
PUSHED_VERSION=$(cut -d'/' -f3 <<< "$GITHUB_REF")
LATEST_RELEASED_VERSION=$(curl -s https://raw.githubusercontent.com/netz98/n98-magerun2/master/version.txt | tr -d '[:space:]')
echo "pushed_version=$PUSHED_VERSION" >> $GITHUB_ENV
echo "latest_released_version=$LATEST_RELEASED_VERSION" >> $GITHUB_ENV
- uses: jackbilestech/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
head: '${{ env.pushed_version }}'
base: '${{ env.latest_released_version }}'
- 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@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- 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@v3
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@v3
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:]')
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
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" ]
if: startsWith(github.ref, 'refs/tags/')
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@v3
with:
name: n98-magerun2.phar
- name: Update dist repo
run: .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@v3
with:
name: n98-magerun2.phar
- name: 'Build Changelog'
uses: mikepenz/release-changelog-builder-action@v4
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@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{steps.build_changelog.outputs.changelog}}
files: |
n98-magerun2.phar
n98-magerun2.phar.asc