Skip to content

Commit

Permalink
Merge pull request #48 from alleyinteractive/built-release-workflow
Browse files Browse the repository at this point in the history
Built release workflow
  • Loading branch information
srtfisher authored Mar 24, 2022
2 parents 282ec05 + a8efbda commit af5cc01
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install dependencies
uses: php-actions/composer@v4
with:
php_version: 7.4
php_version: 8.0
composer_version: 2
args: --prefer-dist --no-dev
- name: Extract branch name
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4]
php: [8.0]
name: PHP ${{ matrix.php }}
steps:
- name: Checkout code
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Create a -built tag

on:
push:
tags:
- 'v*.*.*'
- '!*-built'

jobs:
built-branch:
name: Create Built Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Clear previous vendor
shell: bash
run: rm -rf vendor && rm -rf composer.lock
- name: Install dependencies
uses: php-actions/composer@v4
with:
php_version: 8.0
composer_version: 2
args: --prefer-dist --no-dev
- name: Extract branch name
shell: bash
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
id: vars
- name: Push to -built branch
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILT_BRANCH: '${{ steps.vars.outputs.tag }}-built'
TAG_NAME: '${{ steps.vars.outputs.tag }}-built'
run: |
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
rm -rf .gitignore docker_tag output.log .github
mv .deployignore .gitignore
git checkout -b $BUILT_BRANCH
git add -A && git commit -m "Built changes for $TAG_NAME"
git tag -a "$TAG_NAME" -m "Build assets for $TAG_NAME"
git push origin "refs/tags/$TAG_NAME"
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
tags:
- 'v*-built' # Create releases for built branches (eg. v2.0.8-built)

name: Create -built release

jobs:
release:
name: Create release
runs-on: ubuntu-latest

steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by Actions
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: A version that contains Composer dependencies for use as a submodule.
draft: false
prerelease: true
145 changes: 0 additions & 145 deletions bin/install-wp-tests.sh

This file was deleted.

30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@
}
],
"require": {
"php": "^7.4|^8.0",
"php": "^7.4 || ^8.0",
"alleyinteractive/composer-wordpress-autoloader": "^0.2.0",
"monolog/monolog": "^2.0",
"psr/log": "^1.1",
"alleyinteractive/composer-wordpress-autoloader": "^0.2.0"
},
"require-dev": {
"psr/log": "^1.1"
},
"require-dev": {
"alleyinteractive/alley-coding-standards": "^0.3",
"alleyinteractive/mantle-framework": "dev-main",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^8.5.8 || ^9.3.3"
},
"config": {
"apcu-autoloader": true,
"optimize-autoloader": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"alleyinteractive/composer-wordpress-autoloader": true
}
"alleyinteractive/composer-wordpress-autoloader": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
"apcu-autoloader": true,
"optimize-autoloader": true
},
"extra": {
"wordpress-autoloader": {
"autoload": {
"AI_Logger\\": "inc/"
"wordpress-autoloader": {
"autoload": {
"AI_Logger\\": "inc/"
}
}
}
},
"scripts": {
"phpcs": "phpcs --standard=./phpcs.xml .",
"phpcbf": "phpcbf --standard=./phpcs.xml .",
"phpcs": "phpcs --standard=./phpcs.xml .",
"phpunit": "phpunit",
"test": "@phpunit"
}
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit af5cc01

Please sign in to comment.