Notification system fixes #23
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: Update Release with Plugin ZIP | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- master | |
jobs: | |
build-and-release: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Build Stage | |
run: | | |
npm install | |
npm run plugin-zip | |
- name: Get version from package.json | |
id: package-version | |
uses: martinbeentjes/[email protected] | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.package-version.outputs.current-version }} | |
release_name: Release ${{ steps.package-version.outputs.current-version }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./modula-best-grid-gallery-${{ steps.package-version.outputs.current-version }}.zip | |
asset_name: modula-best-grid-gallery-${{ steps.package-version.outputs.current-version }}.zip | |
asset_content_type: application/zip | |
- name: Modula Deploy | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
env: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SLUG: modula-best-grid-gallery | |
VERSION: ${{ steps.package-version.outputs.current-version }} | |
- name: Get changelog | |
id: changelog | |
shell: bash | |
run: | | |
echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
version=$(echo "${{ steps.package-version.outputs.current-version }}" | sed 's/^v//') | |
awk -v ver="$version" ' | |
BEGIN {latest_ver = "0.0.0"} | |
/^= / { | |
split($2, a, "-"); | |
if (a[1] <= ver && a[1] > latest_ver) { | |
latest_ver = a[1]; | |
p = 1; | |
print "Latest version: " latest_ver; | |
print "Changelog:"; | |
print; | |
next; | |
} | |
if (p) exit; | |
} | |
p | |
' changelog.txt >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Notify on Slack | |
uses: bloodyowl/[email protected] | |
with: | |
version: ${{ steps.package-version.outputs.current-version }} | |
changelog: ${{ steps.changelog.outputs.changelog }} | |
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} |