Merge pull request #34 from sam-cogan/samcogan/ttk-update #25
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
# This is a basic workflow to help you get started with Actions | |
name: Release Extension | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
paths: | |
- 'arm-ttk-extension-xplatform/*' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
# Repository name with owner. For example, actions/checkout | |
repository: Azure/arm-ttk | |
path: ttk_files | |
- name: Copy file | |
run: | | |
rm -r arm-ttk-extension-xplatform/arm-ttk/testcases/ | |
cp -r ttk_files/arm-ttk/testcases/ arm-ttk-extension-xplatform/arm-ttk/testcases/ | |
- name: Replace Action | |
uses: datamonsters/replace-action@v2 | |
with: | |
# Files, comma-separated. Supposed PLACEHOLDER in them | |
files: vss-extension.json | |
# Comma-separated pairs PLACEHOLDER=value | |
replacements: $buildnumber$=${{ github.run_number }} | |
- name: Replace Text in task.json | |
uses: datamonsters/replace-action@v2 | |
with: | |
# Files, comma-separated. Supposed PLACEHOLDER in them | |
files: arm-ttk-extension-xplatform/task.json | |
# Comma-separated pairs PLACEHOLDER=value | |
replacements: $taskid$=cb27e003-8534-4da9-aaa0-35ca8756ae29, $taskname$=RunARMTTKTestsXPlat, $taskdisplayname$= | |
- name: create package | |
run: | | |
cd arm-ttk-extension-xplatform | |
npm install | |
tsc | |
cd .. | |
npx tfx-cli extension create --manifest-globs vss-extension.json | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: extension | |
path: Sam-Cogan.ARMTTKExtensionXPlatform-1.0.${{ github.run_number }}.vsix | |
- name: GH Release | |
uses: softprops/action-gh-release@master | |
with: | |
name: ARM TTK Extension v1.0.${{ github.run_number }} | |
files: Sam-Cogan.ARMTTKExtensionXPlatform-1.0.${{ github.run_number }}.vsix | |
tag_name: v1.0.${{ github.run_number }} | |
env: | |
GITHUB_TOKEN: ${{secrets.deploy_key}} | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact | |
uses: actions/[email protected] | |
with: | |
name: extension | |
- name: publish-extension | |
run: | | |
npx tfx-cli extension publish --vsix extension/Sam-Cogan.ARMTTKExtensionXPlatform-1.0.${{ github.run_number }}.vsix --token ${{secrets.marketplace_pat}} | |