Skip to content

Commit

Permalink
ci: release automation (#1215)
Browse files Browse the repository at this point in the history
* ci: release automation

* build: npm build

---------

Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
arzola and actions-user authored Apr 25, 2024
1 parent c2365c9 commit 70dd174
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 72 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ensure-npm-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Npm build ⚙️

on:
pull_request:
branches: [ dev ]

jobs:
update-npm-build:
uses: pressbooks/reusable-workflows/.github/workflows/npm-build.yml@dev
12 changes: 12 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Prepare Release

on:
push:
branches:
- dev

jobs:
deploy:
uses: pressbooks/reusable-workflows/.github/workflows/prepare-release.yml@dev
secrets:
ga_token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 0 additions & 27 deletions .github/workflows/standards-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,33 +75,6 @@ jobs:
uses: codecov/codecov-action@v3
if: matrix.experimental == false

- name: Prepare Build
if: startsWith(github.ref, 'refs/tags/')
run: |
export GITHUB_BUILD_PATH=${{github.workspace}}
export GITHUB_REPO_SLUG="$(basename ${{github.workspace}})"
export GITHUB_TAG="$(basename ${{github.ref}})"
echo "File to be created : $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip"
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
wp package install wp-cli/dist-archive-command
npm install
npm run build
composer install --no-dev --optimize-autoloader
cd ..
wp dist-archive $GITHUB_REPO_SLUG $GITHUB_BUILD_PATH/$GITHUB_REPO_SLUG-$GITHUB_TAG.zip
cd $GITHUB_BUILD_PATH
ls $GITHUB_BUILD_PATH
- name: Deploy
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files:
${{github.workspace}}/*.zip

- name: Trigger Bedrock Update
if: (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/production') && matrix.experimental == false
uses: pressbooks/composer-autoupdate-bedrock@main
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/update-translations.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2.26.2"
}
11 changes: 11 additions & 0 deletions packages/buckram/.idea/buckram.iml

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

8 changes: 8 additions & 0 deletions packages/buckram/.idea/modules.xml

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

19 changes: 19 additions & 0 deletions packages/buckram/.idea/php.xml

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

6 changes: 6 additions & 0 deletions packages/buckram/.idea/vcs.xml

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

2 changes: 1 addition & 1 deletion packages/buckram/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"pixelmatch": "^5.2.1",
"polyserve": "^0.27.15",
"pressbooks-build-tools": "^4.0.0",
"puppeteer": "^21.0.3",
"puppeteer": "^20.5.0",
"sassdoc": "^2.7.1",
"type-detect": "^4.0.8"
},
Expand Down
13 changes: 13 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "simple",
"include-component-in-tag": false,
"include-v-in-tag": false,
"packages": {
".": {
"extra-files": [
"style.css"
]
}
}
}
2 changes: 2 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Tags: Academic, Literary, Nonfiction, Textbook
Author: Pressbooks (Book Oven Inc.)
Author URI: https://pressbooks.com
Copyright: 2011-2023 Pressbooks (Book Oven Inc.) <[email protected]>
x-release-please-start-version
Version: 2.26.2
x-release-please-end
Text Domain: pressbooks-book
License: GPL v3.0 or later
GitHub Theme URI: pressbooks/pressbooks-book
Expand Down

0 comments on commit 70dd174

Please sign in to comment.