add ci for coding standars #1
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: Weekly Release | ||
on: | ||
schedule: | ||
- cron: '0 17 * * 5' | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- release | ||
# Cancels all previous workflow runs for pull requests that have not completed. | ||
concurrency: | ||
# The concurrency group contains the workflow name and the branch name for pull requests | ||
# or the commit hash for any other events. | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
cancel-in-progress: true | ||
jobs: | ||
release: | ||
name: Create Weekly Release | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Ensure full history is fetched | ||
- name: Use desired version of NodeJS | ||
uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: npm | ||
- name: Set up Git | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email 'github-actions@github.com' | ||
- name: Extract version from PHP file | ||
id: get_version | ||
run: | | ||
VERSION=$(grep -oP 'Version:\s*\K[^\s]+' {the-plugin-name}.php) | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Grant execute permissions for build script | ||
run: chmod +x ./bin/build-plugin-zip.sh | ||
- name: Generate plugin zip file | ||
run: ./bin/build-plugin-zip.sh -b | ||
- name: Upload build file as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: {The Plugin Name}-${{ env.VERSION }} | ||
path: ./{the-plugin-name}.zip |