fix: indent #66
Workflow file for this run
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
# Job that makes releases on the main branch. | |
# Excluded files and folders that should not be part of the plugin is defined in .distignore | |
name: Release to WordPress plugin repository | |
on: | |
push: | |
branches: | |
# - main pause for now | |
jobs: | |
calculate-next-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
# Running semantic-release in dry-run mode to calculate the next version, without publishing anything | |
- run: npx semantic-release --dry-run | |
id: calculate-next-version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
new-release-published: ${{ steps.calculate-next-version.outputs.new-release-published }} | |
new-release-version: ${{ steps.calculate-next-version.outputs.new-release-version }} | |
release: | |
runs-on: ubuntu-latest | |
needs: calculate-next-version | |
if: needs.calculate-next-version.outputs.new-release-published == 'true' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install Dependencies | |
run: npm ci | |
- name: Semantic Release - create release | |
id: semantic | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Creates the plugin and excludes the files from .distignore, then deploys it to the WordPress SVN | |
- name: Deploy Plugin to WordPress SVN | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
env: | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SLUG: ledyer-checkout-for-woocommerce | |
# Creates the plugin zip and excludes the files from .distignore, then uploads it as an artifact (unzipped since github zips it automatically) | |
- name: Build plugin zip | |
id: build_zip | |
uses: 10up/action-wordpress-plugin-build-zip@stable | |
# We need to download the plugin artifact to be able to use it in the next steps | |
- name: Download the plugin artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: ${{ github.workspace }}/zipfile | |
# Re-zip the plugin artifact to be able to upload it as a release asset | |
- name: Re-zip the plugin artifact | |
run: | | |
cd zipfile | |
zip -r ../${{ github.event.repository.name }}.zip . | |
# Upload the plugin zip as a release asset | |
- name: Update GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ needs.calculate-next-version.outputs.new-release-version }} | |
files: ./${{ github.event.repository.name }}.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |