Skip to content

Commit

Permalink
Merge pull request #565 from 10up/enhancement/412
Browse files Browse the repository at this point in the history
Updated release GH action workflow files.
  • Loading branch information
dkotter authored Aug 14, 2023
2 parents 4f099b8 + 5aa263e commit d4858c0
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 35 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
name: Build release zip

on:
release:
types: [published]
workflow_dispatch:

jobs:
build_zip:
name: New release
name: Build release zip
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Create ZIP
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: npm install and build
run: |
git archive --prefix=classifai/ HEAD -o classifai.zip
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Upload the ZIP file as an artifact
uses: actions/upload-artifact@v3
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{github.workspace}}/classifai.zip
asset_name: classifai.zip
asset_content_type: application/zip
name: ${{ github.event.repository.name }}
path: release
retention-days: 2
36 changes: 17 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
name: Build Release
name: Release

on:
push:
branches:
- trunk
release:
types: [published]

jobs:
release:
name: Push (merge) to trunk
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: npm install and build
node-version-file: .nvmrc

- name: Install dependencies, build files and archive
run: |
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Release to Stable
uses: s0/git-publish-subdir-action@develop
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
REPO: self
BRANCH: stable
FOLDER: release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: 'Release: ({sha}) {msg}'
- name: Build docs
run: npm run build:docs
- name: Deploy docs update
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: './docs'
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{github.workspace}}/classifai.zip
asset_name: classifai.zip
asset_content_type: application/zip
38 changes: 38 additions & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release to Stable
on:
push:
branches:
- trunk
jobs:
release:
name: Push (merge) to trunk
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: npm install and build
run: |
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Release to Stable
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: stable
FOLDER: release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: 'Release: ({sha}) {msg}'
- name: Build docs
run: npm run build:docs
- name: Deploy docs update
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: './docs'

0 comments on commit d4858c0

Please sign in to comment.