Skip to content

Commit

Permalink
Merge pull request #61 from dreamsicle-io/release/4.2.2-RC2
Browse files Browse the repository at this point in the history
Release/4.2.2 rc2
  • Loading branch information
theenoahmason authored Jun 4, 2024
2 parents 61b3514 + b54f010 commit 3e81600
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Release

on:
push:
branches: [master]
workflow_run:
workflows: [test]
types:
- completed

jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'master' }}
runs-on: ubuntu-latest
steps:

Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Test

on:
push:
branches: [master]

jobs:
release:
runs-on: ubuntu-latest
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Checkout Repo
id: checkout_repo
uses: actions/checkout@v4

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- name: Enter Theme Directory
id: enter_theme_directory
run: cd package

# Gets the name from package.json and sets it as an environment variable.
- name: Set Theme Name
id: set_theme_name
run: echo "THEME_NAME=$(jq -r '.name' package.json)" >> $GITHUB_ENV

# Gets the version from package.json and sets it as an environment variable.
- name: Set Theme Version
id: set_theme_version
run: echo "THEME_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV

# Gets the PHP version from composer.json and sets it as an environment variable.
- name: Set PHP Version
id: set_php_version
run: echo "PHP_VERSION=$(jq -r '.require.php' composer.json) >> $GITHUB_ENV

# Gets the Node version from .nvmrc and sets it as an environment variable.
- name: Set Node Version
id: set_node_version
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV

# Setup PHP.
- name: Setup PHP
id: setup_php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}

# Setup Node.
- name: Setup Node
id: setup_node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

# Installs npm and composer dependencies.
- name: Install
id: install
run: npm ci

# Lint all files.
- name: Lint
id: lint
run: npm run lint

# Runs a build.
- name: Build
id: build
run: npm run build

# Return to root.
- name: Return to Root Directory
id: return_to_root_directory
run: cd ..
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-theme-assets",
"version": "4.2.1",
"version": "4.2.2",
"description": "WP Theme Assets",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion package/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# Gets the PHP version from composer.json and sets it as an environment variable.
- name: Set PHP Version
id: set_php_version
run: echo "PHP_VERSION=$(jq -r '.require["php"]' composer.json) >> $GITHUB_ENV
run: echo "PHP_VERSION=$(jq -r '.require.php' composer.json) >> $GITHUB_ENV

# Gets the Node version from .nvmrc and sets it as an environment variable.
- name: Set Node Version
Expand Down

0 comments on commit 3e81600

Please sign in to comment.