workflow adjusted and version 2.7.3 released #1
Workflow file for this run
This file contains hidden or 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: Deploy to WordPress.org | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| jobs: | |
| tag: | |
| name: New tag | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install SVN (Subversion) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install subversion | |
| - name: WordPress Plugin Deploy | |
| id: deploy | |
| uses: 10up/action-wordpress-plugin-deploy@stable | |
| with: | |
| generate-zip: true | |
| - name: Find Readme File | |
| id: find_readme | |
| run: | | |
| for file in README.txt README.md Readme.txt Readme.md readme.txt readme.md; do | |
| if [ -f "$file" ]; then | |
| echo "Readme file found: $file" | |
| echo "readme_file=$file" >> $GITHUB_ENV | |
| break | |
| fi | |
| done | |
| if [ -z "${{ env.readme_file }}" ]; then | |
| echo "::error::Readme file not found." | |
| exit 1 | |
| fi | |
| - name: Extract Release Notes | |
| id: release_notes | |
| run: | | |
| changelog_section_start="== Changelog ==" | |
| readme_file="${{ env.readme_file }}" | |
| # Read lines from the changelog section | |
| in_changelog=0 | |
| release_notes="" | |
| while IFS= read -r line; do | |
| # Start extracting once we find the changelog section | |
| if [[ "$line" == "$changelog_section_start" ]]; then | |
| in_changelog=1 | |
| continue | |
| fi | |
| # Stop extracting if we reach another section or blank line | |
| if [[ $in_changelog -eq 1 && "$line" =~ ^== ]]; then | |
| break | |
| fi | |
| # Add valid lines to the release notes | |
| if [[ $in_changelog -eq 1 && -n "$line" ]]; then | |
| release_notes+="$line\n" | |
| fi | |
| done < "$readme_file" | |
| # Check if release notes were extracted | |
| if [[ -z "$release_notes" ]]; then | |
| echo "::error::Failed to extract release notes from the changelog section." | |
| exit 1 | |
| fi | |
| # Set output | |
| echo "::set-output name=notes::$release_notes" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| body: ${{ steps.release_notes.outputs.notes }} | |
| files: ${{github.workspace}}/${{ github.event.repository.name }}.zip | |
| env: | |
| SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
| SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |