diff --git a/.github/workflows/build-release-zip.yml b/.github/workflows/build-release-zip.yml index 5e810082e..e0738668c 100644 --- a/.github/workflows/build-release-zip.yml +++ b/.github/workflows/build-release-zip.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2c73256e..3cfeb4000 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml new file mode 100644 index 000000000..cb43f76b2 --- /dev/null +++ b/.github/workflows/stable.yml @@ -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'