From 2d18af628095226da249cd85ee9c371c230b9a03 Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Thu, 17 Mar 2022 20:34:21 +0100 Subject: [PATCH] New release process: publish deployer.phar in a tag (#3051) Merges deployer/dist & deployer/deployer. --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++-- deploy.yaml | 6 ------ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2337b35b5..5c40d3674 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV @@ -28,9 +28,41 @@ jobs: - name: Calculate sha1 run: echo "SHA1=$(sha1sum deployer.phar | awk '{print $1;}')" >> $GITHUB_ENV - - name: Release + - name: Update manifest uses: deployphp/action@v1 with: private-key: ${{ secrets.PRIVATE_KEY }} deployer-binary: bin/dep dep: -f deploy.yaml release -o sha1=${{ env.SHA1 }} -o version=${{ env.RELEASE_VERSION }} + + - name: Add deployer.phar + shell: bash + run: | + set -x + git checkout -b dist + chmod +x deployer.phar + git add -f deployer.phar + + - name: Remove obsolete files & dirs + shell: bash + run: | + set -x + git rm -r .github/ bin/ contrib/ docs/ recipe/ src/ tests/ *.xml *.yaml *.neon *.lock .gitattributes .gitignore + + - name: Update composer.json + shell: bash + run: | + set -x + cat composer.json | jq 'del(.autoload) | del(.scripts) | del(.require) | del(."require-dev") | setpath(["bin"]; "deployer.phar")' > composer-new.json + mv composer-new.json composer.json + git add composer.json + + - name: Push release tag + shell: bash + run: | + set -x + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions" + git commit -m "Deployer $RELEASE_VERSION" + git tag "v$RELEASE_VERSION" --force + git push origin "v$RELEASE_VERSION" --force diff --git a/deploy.yaml b/deploy.yaml index 3318768ca..9caf8fc71 100644 --- a/deploy.yaml +++ b/deploy.yaml @@ -16,12 +16,6 @@ config: tasks: release: - update_manifest - - release_dist - - release_dist: - - desc: Release deployer/dist - - cd: ~/dev/dist - run: php update create_banner: - desc: Create an update banner