WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Update README.md

Update README.md #57

Workflow file for this run

name: Plugin Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Get current version
id: get_version
run: |
version=$(grep -oP 'Version:\s*\K[0-9.]+' snn-tickets.php)
echo "Current version: $version"
echo "version=$version" >> $GITHUB_ENV
- name: Bump version if release
if: contains(github.event.head_commit.message, 'release')
run: |
current_version=$(grep -oP 'Version:\s*\K[0-9.]+' snn-tickets.php)
next_version=$(awk -F. '{print $1 "." ($2+1)}' <<< "$current_version")
sed -i "s/Version: $current_version/Version: $next_version/" snn-tickets.php
echo "new_version=$next_version" >> $GITHUB_ENV
- name: Commit version bump
if: contains(github.event.head_commit.message, 'release')
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add snn-tickets.php
git commit -m "Bump version to ${{ env.new_version }}"
git push
- name: Create zip file
run: |
mkdir -p snn-tickets
rsync -av --exclude='.git' --exclude='.github' --exclude='snn-tickets' ./ snn-tickets/
zip -r snn-tickets.zip snn-tickets
rm -rf snn-tickets
- name: Create GitHub Release
if: contains(github.event.head_commit.message, 'release')
uses: softprops/action-gh-release@v1
with:
files: snn-tickets.zip
tag_name: "v${{ env.new_version }}"
name: "Release v${{ env.new_version }}"
body: "Release v${{ env.new_version }} of the plugin."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Pre-release
if: contains(github.event.head_commit.message, 'alphatag')
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: snn-tickets.zip
tag_name: "pre-v${{ env.version }}"
name: "Pre-release v${{ env.version }}"
body: "Pre-release v${{ env.version }} of the plugin."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}