Skip to content

Commit

Permalink
Merge pull request #63 from mwarzybok-sumoheavy/feature/SP-239release
Browse files Browse the repository at this point in the history
SP-239 Deploy to WooCommerce WordPress.org when released
  • Loading branch information
bobbrodie authored Oct 5, 2023
2 parents 33478e0 + 9a34a90 commit 3ad6e13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ if [[ -z "$SVN_PASSWORD" ]]; then
exit 1
fi

GITHUB_REF=${GITHUB_REF#refs/tags/} # refs/tags/v1.0.0 -> v1.0.0
VERSION="${GITHUB_REF#v}" # v1.0.0 -> 1.0.0
VERSION=${GITHUB_REF#refs/tags/} # refs/tags/1.0.0 -> v1.0.0

SVN_URL="https://plugins.svn.wordpress.org/${SLUG}/"
SVN_DIR="${HOME}/svn-${SLUG}"
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
check-release:
runs-on: ubuntu-20.04
permissions: write-all

steps:
- name: Check out code
Expand All @@ -17,25 +18,26 @@ jobs:
run: |
composer install --no-dev
rm -rf vendor/ -R
rm -rf .git/ -R
- name: Change permissions for release.sh
run: chmod 755 .github/workflows/release.sh

- name: Create Release Artifact
- name: Create Release Assets
run: |
VERSION=${{ github.ref }}
VERSION=${VERSION#refs/tags/}
FILE_NAME=bitpay-checkout-for-woocommerce
mkdir /home/runner/work/release
zip -r /home/runner/work/release/${VERSION}.zip $GITHUB_WORKSPACE
echo "{artifact_name}=${VERSION}.zip" >> $GITHUB_OUTPUT
cd $GITHUB_WORKSPACE
zip -r /home/runner/work/release/${FILE_NAME}.zip ./* > /dev/null
tar -czvf /home/runner/work/release/${FILE_NAME}.tar.gz ./* > /dev/null
shell: bash

- name: Upload Release Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.create_artifact.outputs.artifact_name }}
path: /home/runner/work/release/${{ steps.create_artifact.outputs.artifact_name }}
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} /home/runner/work/release/*

- name: Remove .git directory
run: rm -rf .git/ -R

- name: Copy the files directory with the Git repository to a new subversion tag
env:
Expand Down

0 comments on commit 3ad6e13

Please sign in to comment.