63 lines
2.7 KiB
YAML
63 lines
2.7 KiB
YAML
name: Prepare package release
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
packages:
|
|
description: 'Enter a specific package to release, or packages separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input to the default "-a" will prepare to release all eligible packages.'
|
|
required: false
|
|
default: '-a'
|
|
jobs:
|
|
prepare:
|
|
name: Run prepare script
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/cache-deps
|
|
with:
|
|
workflow_name: prepare-package-release
|
|
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '7.4'
|
|
|
|
- name: Install PNPM
|
|
run: npm install -g pnpm@^6.24.2
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Execute script
|
|
run: ./tools/package-release/bin/dev prepare ${{ github.event.inputs.packages }}
|
|
|
|
- name: Print git status
|
|
run: git status
|
|
|
|
- name: Get current date
|
|
id: date
|
|
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
|
|
|
- name: Set all package string
|
|
id: all_description
|
|
if: ${{ github.event.inputs.packages == '-a'}}
|
|
run: echo "::set-output name=str::all packages"
|
|
|
|
- name: Set Specific packages string
|
|
id: specific_description
|
|
if: ${{ github.event.inputs.packages != '-a'}}
|
|
run: echo "::set-output name=str::${{ github.event.inputs.packages }}"
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: 'Automated change: Prep ${{ steps.all_description.outputs.str || steps.specific_description.outputs.str }} for release.'
|
|
branch: release/packages-${{ steps.date.outputs.date }}
|
|
delete-branch: true
|
|
title: Prepare Packages for Release
|
|
reviewers: ${{ github.actor }}
|
|
body: |
|
|
# Prepare ${{ steps.all_description.outputs.str || steps.specific_description.outputs.str }} for release.
|
|
This PR has been autogenerated by [Prepare Package Release workflow](https://github.com/woocommerce/woocommerce/actions/workflows/prepare-package-release.yml) in run [${{ github.run_id }}](https://github.com/woocommerce/woocommerce/actions/runs/${{ github.run_id }})
|