11name : Deploy to WordPress.org
2+
23on :
34 push :
45 tags :
5- - " *"
6+ - " *"
7+
68jobs :
79 tag :
810 name : New tag
911 runs-on : ubuntu-latest
1012 steps :
11- - uses : actions/checkout@master
12- # - name: Build # Remove or modify this step as needed
13- # run: |
14- # npm install
15- # npm run build
16- - name : Install SVN ( Subversion )
17- run : |
18- sudo apt-get update
19- sudo apt-get install subversion
20- - name : WordPress Plugin Deploy
21- id : deploy
22- uses : 10up/action-wordpress-plugin-deploy@stable
23- with :
24- generate-zip : true
25- env :
26- SVN_PASSWORD : ${{ secrets.SVN_PASSWORD }}
27- SVN_USERNAME : ${{ secrets.SVN_USERNAME }}
28- # SLUG: my-super-cool-plugin # optional, remove if GitHub repo name matches SVN slug, including capitalization
29- - name : Create GitHub release
30- uses : softprops/action-gh-release@v1
31- with :
32- files : ${{github.workspace}}/${{ github.event.repository.name }}.zip
33- env :
34- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13+ - uses : actions/checkout@v3
14+ - name : Install SVN (Subversion)
15+ run : |
16+ sudo apt-get update
17+ sudo apt-get install subversion
18+
19+ - name : WordPress Plugin Deploy
20+ id : deploy
21+ uses : 10up/action-wordpress-plugin-deploy@stable
22+ with :
23+ generate-zip : true
24+
25+ - name : Find Readme File
26+ id : find_readme
27+ run : |
28+ for file in README.txt README.md Readme.txt Readme.md readme.txt readme.md; do
29+ if [ -f "$file" ]; then
30+ echo "::set-output name=readme_file::$file"
31+ break
32+ fi
33+ done
34+
35+ - name : Extract Release Notes
36+ id : release_notes
37+ run : |
38+ if [[ -z "${{ steps.find_readme.outputs.readme_file }}" ]]; then
39+ echo "::error::Readme file not found."
40+ exit 1
41+ fi
42+
43+ release_notes=$(grep '== Changelog ==' "${{ steps.find_readme.outputs.readme_file }}" | head -n -1 | tail -n +2)
44+ echo "::set-output name=notes::$release_notes"
45+
46+ - name : Create GitHub Release
47+ uses : softprops/action-gh-release@v2
48+ with :
49+ tag_name : ${{ github.ref_name }}
50+ body : ${{ steps.release_notes.outputs.notes }}
51+ files : ${{github.workspace}}/${{ github.event.repository.name }}.zip
52+
53+ env :
54+ SVN_PASSWORD : ${{ secrets.SVN_PASSWORD }}
55+ SVN_USERNAME : ${{ secrets.SVN_USERNAME }}
56+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments