Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release process: publish deployer.phar in a tag #3051

Merged
merged 12 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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