-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: cd all in one * fix: use empty as default value of cd pipeline * feat: add sleep before pack visc
- Loading branch information
1 parent
19db834
commit 7795495
Showing
4 changed files
with
116 additions
and
256 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: cd | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'which version to bump(major, minor, patch, premajor, preminor, prepatch, prerelease)' | ||
required: true | ||
default: 'prerelease' | ||
force: | ||
description: 'force release even if no update(set --force-publish if necessary)' | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
cd: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout dev branch | ||
if: ${{ github.event_name == 'schedule' }} | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.CD_PAT }} | ||
ref: dev | ||
|
||
- name: Checkout release branch | ||
if: ${{ github.event_name != 'schedule' }} | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.CD_PAT }} | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v2.1.2 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Setup npm registry | ||
run: | | ||
echo "${{ secrets.NPMRC }}" > ~/.npmrc | ||
- name: Download Simple Auth bits | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 10 | ||
retry_on: error | ||
shell: pwsh | ||
command: | | ||
$version=Get-Content packages/fx-core/templates/plugins/resource/simpleauth/version.txt | ||
$tag = "simpleauth@"+$version | ||
$fileName="Microsoft.TeamsFx.SimpleAuth_$version.zip" | ||
$url = "https://github.com/OfficeDev/TeamsFx/releases/download/"+$tag+"/"+$fileName | ||
Invoke-WebRequest $url -OutFile packages/fx-core/templates/plugins/resource/simpleauth/SimpleAuth.zip | ||
- name: Setup project | ||
run: | | ||
npm run setup | ||
- name: Setup git | ||
run: | | ||
git config --global user.name 'MSFT-yiz' | ||
git config --global user.email 'yiz@microsoft.com' | ||
- name: check whether vscode extension changed or not | ||
id: extension-checker | ||
run: | | ||
if npx lerna changed | grep 'ms-teams-vscode-extension'; | ||
then | ||
echo "::set-output name=CHANGED::true" | ||
else | ||
echo "::set-output name=CHANGED::false" | ||
fi | ||
- name: release daily npm packages to npmjs.org | ||
if: ${{ github.ref == 'refs/heads/dev' && startsWith(github.event.inputs.version, 'pre') }} | ||
run: | | ||
npx lerna publish --no-private --preid=alpha --dist-tag=alpha ${{ github.event.inputs.version }} --yes ${{ github.event.inputs.force }} | ||
- name: release rc npm packages to npmjs.org | ||
if: ${{ startsWith(github.ref, 'refs/heads/release/') && github.event.inputs.version == 'prerelease' }} | ||
run: | | ||
npx lerna publish --no-private --preid=rc --dist-tag=rc prerelease --yes ${{ github.event.inputs.force }} | ||
- name: release stable npm packages to npmjs.org | ||
if: ${{ startsWith(github.ref, 'refs/heads/release/') && !startsWith(github.event.inputs.version, 'pre') }} | ||
run: | | ||
npx lerna publish --no-private --dist-tag=latest ${{ github.event.inputs.version }} --yes ${{ github.event.inputs.force }} | ||
- name: pack vsix | ||
id: pack-vsix | ||
uses: nick-invision/retry@v2 | ||
with: | ||
timeout_minutes: 10 | ||
max_attempts: 10 | ||
retry_on: error | ||
command: | | ||
sleep 5 | ||
cd ./packages/vscode-extension | ||
npm install | ||
npx vsce package | ||
VERSION=`ls *.vsix | awk -F '.vsix' '{print $1}'` | ||
echo "::set-output name=VERSION::$VERSION" | ||
- name: release VSCode extension to github | ||
if: ${{ steps.extension-checker.outputs.CHANGED == 'true' || github.event.inputs.force == '--force-publish' }} | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: ${{ secrets.CD_PAT }} | ||
prerelease: true | ||
automatic_release_tag: ${{ steps.pack-vsix.outputs.VERSION }} | ||
files: | | ||
./packages/**/*.vsix |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.