Skip to content

Commit

Permalink
Added repo and codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrinc committed Oct 8, 2024
1 parent 9a93684 commit 53d0d52
Show file tree
Hide file tree
Showing 8 changed files with 1,272 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Version Bump

on:
push:
branches:
- master

jobs:
version-bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get latest tag
id: get_latest_tag
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0 || echo v0.0.0)" >> $GITHUB_OUTPUT

- name: Bump version and push tag
id: bump_version
run: |
# Extract version number and increment patch
version=$(echo ${{ steps.get_latest_tag.outputs.LATEST_TAG }} | sed 's/v//')
IFS='.' read -ra ADDR <<< "$version"
new_patch=$((ADDR[2] + 1))
new_version="${ADDR[0]}.${ADDR[1]}.$new_patch"
echo "NEW_VERSION=v$new_version" >> $GITHUB_OUTPUT
# Configure Git
git config user.name github-actions
git config user.email github-actions@github.com
# Create and push new tag
git tag v$new_version
git push origin v$new_version
outputs:
new_version: ${{ steps.bump_version.outputs.NEW_VERSION }}
40 changes: 40 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Replace version in PHP file
run: sed -i 's/{{VERSION}}/${{ steps.get_version.outputs.VERSION }}/g' src/betterportal-theme-embedded.php

- name: Create release folder
run: mkdir betterportal-theme-embedded

- name: Copy files to release folder
run: |
cp -R src/* betterportal-theme-embedded/
cp README.md betterportal-theme-embedded/
cp LICENSE betterportal-theme-embedded/
- name: Create ZIP archive
run: zip -r betterportal-theme-embedded.zip betterportal-theme-embedded

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.get_version.outputs.VERSION }} \
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
--notes "Release ${{ steps.get_version.outputs.VERSION }}" \
betterportal-theme-embedded.zip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
/build
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# BetterPortal Embedded Theme

This plugin pulls in pages hosted with BetterPortal Embedded Theme and displays them within your WP site.

NOTE: If you are not using BetterPortal, then do not install this plugin.

## Installation

1. Install the plugin via the WordPress admin.
2. Activate the plugin.
3. Use the [betterportal_embed] shortcode in your posts or pages - or use the Elementor Widget.

See your BetterPortal admin portal for more information.

Reference: [https://betterportal.cloud](https://betterportal.cloud)
24 changes: 24 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Usage: $0 <version>"
exit 1
fi

VERSION=$1
SOURCE_DIR="src/*"
BUILD_DIR="build"
DIST_DIR="dist"

rm -rf $DIST_DIR $BUILD_DIR
mkdir -p $BUILD_DIR $DIST_DIR
cp -r $SOURCE_DIR $BUILD_DIR
cp README.md $BUILD_DIR/README.txt
cp LICENSE $BUILD_DIR/LICENSE.txt

sed -i "s/{{VERSION}}/$VERSION/g" $BUILD_DIR/*
sed -i "s/{{VERSION}}/$VERSION/g" $BUILD_DIR/**/*

zip -r $DIST_DIR/betterportal-theme-embedded-$VERSION.zip $BUILD_DIR

rm -rf $BUILD_DIR
Loading

0 comments on commit 53d0d52

Please sign in to comment.