Update github actions for creating release branches and publishing new releases (#534)
This commit is contained in:
Родитель
9b5ab1dca3
Коммит
e232d5ae4e
|
@ -1,4 +1,5 @@
|
|||
name: Bump npm packages and create changelogs
|
||||
# Bump package version numbers and create a release branch
|
||||
name: Create release branch
|
||||
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
|
@ -52,21 +53,23 @@ jobs:
|
|||
- name: Bump package versions
|
||||
run: node common/config/node_modules/beachball/bin/beachball bump
|
||||
|
||||
# Get datetime for release branch name
|
||||
- name: Create datetime
|
||||
id: datetime
|
||||
# Retrieve new version to create branch with
|
||||
- name: Retrieve new version from package.json
|
||||
id: version
|
||||
run: |
|
||||
echo "::set-output name=datetime::$(TZ=":America/Vancouver" date +'%Y-%m-%d-%H%M')"
|
||||
ver=$(jq -r .version packages/communication-react/package.json)
|
||||
echo version: $ver
|
||||
echo "::set-output name=version::$ver"
|
||||
|
||||
# Commit and push changes
|
||||
- name: Hop into new branch
|
||||
run: git checkout -b release/${{ steps.datetime.outputs.datetime }}
|
||||
run: git checkout -b release/${{ steps.version.outputs.version }}
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add .
|
||||
git commit -m "Version bump"
|
||||
- name: Push branch
|
||||
run: git push --set-upstream origin release/${{ steps.datetime.outputs.datetime }}
|
||||
run: git push --set-upstream origin release/${{ steps.version.outputs.version }}
|
||||
|
||||
# Create a PR from the changes
|
||||
- name: Create PR
|
||||
|
@ -76,5 +79,5 @@ jobs:
|
|||
-H 'Accept: application/vnd.github.v3+json' \
|
||||
-H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
|
||||
https://api.github.com/repos/Azure/communication-ui-library/pulls \
|
||||
-d '{ "title":"Package Version Bump - ${{ steps.datetime.outputs.datetime }}", "head":"release/${{ steps.datetime.outputs.datetime }}", "base":"main", "body":"PR setup by the automated version bump github action. Please review." }'
|
||||
-d '{ "title":"Package Version Bump - ${{ steps.version.outputs.version }}", "head":"release/${{ steps.version.outputs.version }}", "base":"main", "body":"PR setup by the automated version bump github action. Please review." }'
|
||||
--fail
|
||||
|
|
|
@ -13,6 +13,9 @@ on:
|
|||
|
||||
jobs:
|
||||
publish:
|
||||
environment:
|
||||
name: npm
|
||||
url: https://www.npmjs.com/package/@azure/communication-react
|
||||
name: Publish release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -44,10 +47,6 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: rush install
|
||||
|
||||
# Perform changelog check
|
||||
- name: Guard check - ensure no new changes were introduced
|
||||
run: node common/config/node_modules/beachball/bin/beachball check
|
||||
|
||||
# Builds
|
||||
- name: Build Packages and Samples
|
||||
run: rush build
|
||||
|
@ -58,6 +57,43 @@ jobs:
|
|||
env:
|
||||
CI: true
|
||||
|
||||
# Publish
|
||||
- name: Publish to npm
|
||||
run: echo Publishing not setup yet. Tag=${{ github.event.inputs.npm-tag }}
|
||||
# Retrieve new version to tag and publish release with
|
||||
- name: Retrieve new version from package.json
|
||||
id: version
|
||||
run: |
|
||||
ver=$(jq -r .version packages/communication-react/package.json)
|
||||
echo version: $ver
|
||||
echo "::set-output name=version::$ver"
|
||||
|
||||
# Push git tags
|
||||
- name: Create and push git tags
|
||||
run: |
|
||||
git tag ${{ steps.version.outputs.version }}
|
||||
git push --tags
|
||||
|
||||
# Publish package
|
||||
- name: Package alpha packages for release
|
||||
run: npm pack
|
||||
working-directory: ./packages/communication-react
|
||||
|
||||
# Deploy npm package - this is done by uploading to Azure's SDK blob storage then triggering their partner release pipeline.
|
||||
# More info: https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/1/Partner-Release-Pipeline
|
||||
- name: Upload tarball to blob storage
|
||||
uses: azure/CLI@v1
|
||||
with:
|
||||
inlineScript: |
|
||||
az login --service-principal -u ${{ secrets.AZURESDKPARTNERDROPS_CLIENT_ID }} -p ${{ secrets.AZURESDKPARTNERDROPS_SERVICE_PRINCIPAL_KEY }} --tenant ${{ secrets.AZURESDKPARTNERDROPS_TENANT_ID }}
|
||||
az extension add --name storage-preview
|
||||
az storage azcopy blob upload -s "packages/communication-react/release/*" -c "drops/azure-communication-services/react/npm/${{ steps.version.outputs.version }}" --account-name azuresdkpartnerdrops
|
||||
|
||||
- name: Install github actions dependencies
|
||||
run: npm ci
|
||||
working-directory: ./.github/workflows/azure-pipeline-action-fork
|
||||
|
||||
- name: Trigger alpha package release pipeline
|
||||
uses: ./.github/workflows/azure-pipeline-action-fork
|
||||
with:
|
||||
azure-devops-project-url: 'https://dev.azure.com/azure-sdk/internal'
|
||||
azure-pipeline-name: 'azuresdkpartnerdrops to npm'
|
||||
azure-devops-token: '${{ secrets.AZURE_SDK_RELEASE_PIPELINE_DEVOPS_TOKEN }}'
|
||||
azure-pipeline-variables: '{"accessLevel": "public", "BlobPath": "azure-communication-services/react/npm/${{ steps.version.outputs.version }}", "registry": "https://registry.npmjs.org/", "skipDiff": "False", "tag": "${{ github.event.inputs.npm-tag }}"}'
|
||||
|
|
Загрузка…
Ссылка в новой задаче