Skip to content

[AppRouter] Initial Setup & Data-Fetching in Server Components (#781) #508

[AppRouter] Initial Setup & Data-Fetching in Server Components (#781)

[AppRouter] Initial Setup & Data-Fetching in Server Components (#781) #508

name: Release @next
on:
push:
branches:
- develop
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
packages:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install Dependencies
run: npm ci
- name: Enter pre next
run: |
[[ ! -f .changeset/pre.json ]] && npx changeset pre enter next || echo 'already in pre mode'
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: npm run publish
version: npm run version
title: "Release"
commit: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
plugin-release:
runs-on: ubuntu-latest
needs: [packages]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish to the publishing repository
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_GITHUB_TOKEN }}
with:
source-directory: wp/headless-wp/
destination-github-username: '10up'
destination-repository-name: 'headstartwp-plugin'
user-email: [email protected]
commit-message: See ORIGIN_COMMIT from $GITHUB_REF
target-branch: next
- name: Checkout the publishing repository
uses: actions/checkout@v3
with:
repository: 10up/headstartwp-plugin
path: 'repo'
ref: next
token: ${{ secrets.API_GITHUB_TOKEN }}
- name: Create Github Tag
run: echo "VERSION=$(cat repo/package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Tag
run: |
cd repo
git fetch --all --tags
echo "Releasing version $VERSION ..."
if [ $(git tag -l "$VERSION") ]; then
echo "Plugin version already published"
else
git config user.name github-actions
git config user.email [email protected]
git checkout -b "$VERSION"
git tag "$VERSION"
git push --tags
git push --all origin
fi