Skip to content

CD-13212676242-yuqzho/test-cd-alpha- #2292

CD-13212676242-yuqzho/test-cd-alpha-

CD-13212676242-yuqzho/test-cd-alpha- #2292

Workflow file for this run

name: CD
run-name: CD-${{ github.run_id }}-${{ github.ref_name }}-${{ inputs.preid }}-${{ inputs.series }}
on:
workflow_dispatch:
inputs:
preid:
description: "preid name(alpha, preview, rc, stable)"
required: true
default: "preview"
series:
description: "release sprint series name"
required: false
default: ""
pkgs:
type: string
required: false
description: "Please enter the package names you want to publish, such as cli, vscode, ui, sdk, server and template. Please separate multiple entries with spaces"
schedule:
- cron: "0 16 * * *"
permissions:
actions: read
contents: read
jobs:
cd:
runs-on: ubuntu-latest
env:
CI: true
PREID: ${{ github.event.inputs.preid }}
steps:
- name: Validate inputs for release
if: ${{ github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/release/') && github.event.inputs.preid == 'alpha' }}
run: |
echo It's not allowed to run CD on release branch for alpha.
exit 1
- name: Valiadte inputs for dev
if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev' && github.event.inputs.preid != 'alpha' }}
run: |
echo It's only allowed to alpha on dev branch.
exit 1
- name: Validate schedule
if: ${{ github.event_name == 'schedule' && github.ref != 'refs/heads/dev' }}
run: |
echo It's not allowed to run schedule release except dev branch.
exit 1
- name: Checkout branch
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CD_PAT }}
ref: ${{ github.ref }}
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v4
- name: Install wine64
run: |
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
sudo apt update
sudo apt install --install-recommends winehq-stable -y
wine --version
- name: Setup npm registry
run: |
echo "${{ secrets.NPMRC }}" > ~/.npmrc
- name: manage pkgs to release
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pkgs }}
run: bash .github/scripts/lerna.sh ${{github.event.inputs.pkgs}}
- name: Setup project
run: |
npm run setup
- name: Setup git
run: |
git config --global user.name 'MSFT-yiz'
git config --global user.email '[email protected]'
- name: replace sideloading placeholders
run: bash .github/scripts/sideloading-replace.sh
env:
SIDELOADING_SERVICE_ENDPOINT: ${{ secrets.SIDELOADING_SERVICE_ENDPOINT }}
SIDELOADING_SERVICE_SCOPE: ${{ secrets.SIDELOADING_SERVICE_SCOPE }}
- name: commit change on local
run: |
git add packages/fx-core/src/component/m365/serviceConstant.ts
git commit -m "build: replace sideloading placeholders"
- name: enable prerelease only features
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.preid == 'alpha' || github.event.inputs.preid == 'preview')) }}
run: |
bash .github/scripts/prerelease-feature-control.sh
echo "next"
changes_detected=$(git status --porcelain | grep "packages/vscode-extension/src/releaseBasedFeatureSettings.ts")
if [ -n "$changes_detected" ]; then
echo "Changes detected in releaseBasedFeatureSettings.ts"
git add packages/vscode-extension/src/releaseBasedFeatureSettings.ts
git commit -m "build: adjust prerelease feature settings"
else
echo "No changes detected in releaseBasedFeatureSettings.ts"
fi