delint #11
Workflow file for this run
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: 'release' | |
on: | |
push: | |
tags: [ '*' ] | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: "mbstring, gd, bcmath, bz2" | |
- name: PHPCS checker | |
id: php-codesniffer | |
run: make lint | |
- uses: act10ns/slack@v1 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
channel: '#bread' | |
if: failure() | |
package: | |
runs-on: ubuntu-22.04 | |
env: | |
BUILD_DIR: "build" | |
DIST_DIR_GITHUB: "dist/github" | |
GITHUB_RELEASE_FILENAME: "bread.zip" | |
PLUGIN: "bread" | |
MAINFILE: "bmlt-meeting-list.php" | |
needs: [ lint ] | |
steps: | |
- uses: actions/checkout@v3 | |
id: code-checkout | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: "mbstring, gd, bcmath, bz2" | |
- name: Build package | |
id: build-package | |
run: | | |
export ZIP_FILENAME=${PLUGIN}-build${GITHUB_RUN_NUMBER}-${GITHUB_SHA}.zip | |
find ./ -type d | xargs chmod 755 | |
find ./ -name '*.php' | xargs chmod 644 | |
echo ${GITHUB_SHA} > build.txt | |
PROD=1 make build | |
zip $ZIP_FILENAME build.txt | |
mv $ZIP_FILENAME ${PLUGIN}-${GITHUB_REF##*/}.zip | |
mkdir -p $DIST_DIR_GITHUB && cp $BUILD_DIR/$ZIP_FILENAME $DIST_DIR_GITHUB/$GITHUB_RELEASE_FILENAME | |
curl -LO https://raw.githubusercontent.com/bmlt-enabled/release-notes-tool/master/gh-release-notes.sh | |
chmod +x gh-release-notes.sh | |
./gh-release-notes.sh readme.txt "wp" | |
curl -LO https://raw.githubusercontent.com/bmlt-enabled/bmlt-wordpress-deploy/master/deploy-wordpress.sh | |
chmod +x deploy-wordpress.sh | |
echo "ARTIFACT_PATH=./${PLUGIN}-${GITHUB_REF##*/}.zip" >> $GITHUB_ENV | |
echo "ARTIFACT_NAME=${PLUGIN}-${GITHUB_REF##*/}.zip" >> $GITHUB_ENV | |
- name: Release beta | |
if: contains(github.ref, 'beta') | |
id: beta_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
prerelease: true | |
draft: false | |
- name: Upload Beta Asset | |
if: contains(github.ref, 'beta') | |
id: beta-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.beta_release.outputs.upload_url }} | |
asset_path: ${{ env.ARTIFACT_PATH }} | |
asset_name: ${{ env.ARTIFACT_NAME }} | |
asset_content_type: application/zip | |
- name: Release stable | |
if: "!contains(github.ref, 'beta')" | |
id: stable_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
body_path: "changelog.txt" | |
prerelease: false | |
draft: false | |
- name: Upload Stable Asset | |
if: "!contains(github.ref, 'beta')" | |
id: stable-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.stable_release.outputs.upload_url }} | |
asset_path: ${{ env.ARTIFACT_PATH }} | |
asset_name: ${{ env.ARTIFACT_NAME }} | |
asset_content_type: application/zip | |
- name: Wordpress Release | |
if: "!contains(github.ref, 'beta')" | |
id: wordpress-stable-release | |
env: | |
WORDPRESS_USERNAME : ${{ secrets.WORDPRESS_USERNAME }} | |
WORDPRESS_PASSWORD : ${{ secrets.WORDPRESS_PASSWORD }} | |
run: | | |
./deploy-wordpress.sh |