Skip to content

Commit

Permalink
New release process: publish deployer.phar in a tag (#3051)
Browse files Browse the repository at this point in the history
Merges deployer/dist & deployer/deployer.
  • Loading branch information
antonmedv authored Mar 17, 2022
1 parent 04fb68d commit 2d18af6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 0 additions & 6 deletions deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d18af6

Please sign in to comment.