Skip to content

Commit

Permalink
Merge pull request #1680 from xwp/fix/build-process
Browse files Browse the repository at this point in the history
Fix the build process
  • Loading branch information
bartoszgadomski authored Jan 16, 2025
2 parents 688bff1 + 74429ea commit eb1793a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ renovate.json
.idea
.vscode
.wordpress-org
build
dist
local
node_modules
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/deploy-to-stream-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ jobs:
- name: Setup environment
run: |
set -ex
ROOT_DIR="$(git rev-parse --show-toplevel)"
WORKING_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
SRC_DIR="$ROOT_DIR/build"
SRC_DIR="$ROOT_DIR/source"
DIST_DIR="$ROOT_DIR/dist"
DIST_BRANCH="${GITHUB_REF#refs/heads/}"
DIST_TAG="${GITHUB_REF#refs/tags/}"
COMMIT_MESSAGE="$(git log -1 --oneline)"
echo "ROOT_DIR=$ROOT_DIR" >> $GITHUB_ENV
echo "WORKING_BRANCH=$WORKING_BRANCH" >> $GITHUB_ENV
echo "SRC_DIR=$SRC_DIR" >> $GITHUB_ENV
Expand All @@ -77,12 +77,12 @@ jobs:
- name: Sync files locally
run: |
set -ex
rm -rf "$SRC_DIR"
rm -rf "$DIST_DIR"
mkdir -p "$SRC_DIR"
rsync -av --exclude-from=.distignore "$ROOT_DIR/" "$SRC_DIR/"
env:
ROOT_DIR: ${{ env.ROOT_DIR }}
Expand All @@ -103,19 +103,19 @@ jobs:
- name: Deploy to xwp/stream-dist
run: |
set -ex
export GIT_DIR="$DIST_DIR/.git"
export GIT_WORK_TREE="$DIST_DIR"
git clone --progress --verbose ${{ vars.DIST_REPO }} "$DIST_DIR/.git"
git checkout -B "$DIST_BRANCH"
# Use the release bundle as the work tree.
export GIT_WORK_TREE="$SRC_DIR"
git add --all
git commit --allow-empty --message "$COMMIT_MESSAGE"
if [ "${{ github.event_name }}" = "release" ]; then
echo "Tagging a release: $DIST_TAG"
git tag --force "$DIST_TAG"
Expand Down

0 comments on commit eb1793a

Please sign in to comment.