Skip to content

Commit

Permalink
build: first test to for reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianSchuetze committed Oct 1, 2023
1 parent 595707f commit 2123142
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 87 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ jobs:
- name: Lint
run: npm run lint

- name: Build (prod)
- name: Build
run: npm run build:prod

- name: Package (prod)
- name: Package
run: npm run package:prod

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: banner-settings-extension
path: ${{ github.workspace }}/*.vsix
path: |
${{ github.workspace }}/ado-manifests/*
${{ github.workspace }}/*.vsix
44 changes: 44 additions & 0 deletions .github/workflows/release.job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Stage Release
on:
workflow_call:
inputs:
env_suffix:
required: true
type: string
secrets:
azure_devops_token:
required: true

jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.env_suffix }}
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
run_id: ${{ github.event.workflow_run.id }}
name: banner-settings-extension
path: ./artifacts
search_artifacts: true

- name: Install TFX CLI
run: npm install -g tfx-cli

- name: Find VSIX filename
id: findfile
run: echo "VSIX_FILE_NAME=$(ls ./artifacts/*.vsix)" >> $GITHUB_ENV

- name: Publish
run: |
SHARE_OPTION=""
if [[ "${{ inputs.env_suffix }}" == "prod" ]]; then
SHARE_OPTION="--share-with razorspoint-test"
fi
tfx extension publish \
--vsix ./${{ env.VSIX_FILE_NAME }} \
--publisher razorspoint \
--manifests ./artifacts/ado-manifests/azure-devops-extension-base.json \
--overrides-file ./artifacts/ado-manifests/azure-devops-extension-${{ inputs.env_suffix }}.json \
$SHARE_OPTION \
--token ${{ secrets.azure_devops_token }}
34 changes: 13 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,17 @@ on:
- completed

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/master' }}
environment: development
deploy_test:
uses: ./.github/workflows/release.job.yml
with:
env_suffix: 'test'
secrets:
azure_devops_token: ${{ secrets.AZURE_DEVOPS_TOKEN }}

steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
run_id: ${{ github.event.workflow_run.id }}
name: banner-settings-extension
path: ./artifacts
search_artifacts: true

- name: Install TFX CLI
run: npm install -g tfx-cli

- name: Authenticate and Publish
env:
AZURE_DEVOPS_EXT_PAT: ${{ secrets.AZURE_DEVOPS_TOKEN }}
run: |
tfx extension publish --manifest-globs vss-extension.json --service-url https://dev.azure.com/myorg --token $AZURE_DEVOPS_EXT_PAT
deploy_prod:
needs: deploy_test
uses: ./.github/workflows/release.job.yml
with:
env_suffix: 'prod'
secrets:
azure_devops_token: ${{ secrets.AZURE_DEVOPS_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://dev.azure.com/ms/banner-settings-ado-extension/_apis/build/status/microsoft.banner-settings-ado-extension?branchName=master)](https://dev.azure.com/ms/banner-settings-ado-extension/_build/latest?definitionId=259&branchName=master)
[![Build Extension](https://github.com/RazorSPoint/banner-settings-ado-extension/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/RazorSPoint/banner-settings-ado-extension/actions/workflows/build.yml)

Banner Settings provides a settings pane under Organization Settings to allow Project Collection Administrators to show sitewide banners. Alert your Azure DevOps users to upcoming changes or events without sending out mass emails. Compatible with Azure DevOps Services and Server.

Expand Down
8 changes: 4 additions & 4 deletions ado-manifests/azure-devops-extension-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
],
"links": {
"repository": {
"uri": "https://github.com/microsoft/banner-settings-ado-extension"
"uri": "https://github.com/RazorSPoint/banner-settings-ado-extension"
},
"issues": {
"uri": "https://github.com/microsoft/banner-settings-ado-extension/issues"
"uri": "https://github.com/RazorSPoint/banner-settings-ado-extension/issues"
},
"support": {
"uri": "https://github.com/microsoft/banner-settings-ado-extension/issues"
"uri": "https://github.com/RazorSPoint/banner-settings-ado-extension/issues"
}
},
"repository": {
"type": "git",
"uri": "https://github.com/microsoft/banner-settings-ado-extension"
"uri": "https://github.com/RazorSPoint/banner-settings-ado-extension"
},
"icons": {
"default": "../static/icon.png"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "banner-settings-hub-improved-ppe",
"name": "Banner Settings (PPE)",
"id": "banner-settings-hub-improved-test",
"name": "Banner Settings (Test)",
"version": "1.0.71",
"publisher": "razorspoint",
"public": false,
Expand All @@ -18,7 +18,7 @@
"ms.vss-features.host-dialog-service"
],
"properties": {
"name": "Banner (PPE)",
"name": "Banner (Test)",
"uri": "dist/index.html",
"icon": "asset://static/sample-icon.png"
}
Expand Down
52 changes: 0 additions & 52 deletions azure-pipelines.yml

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build:dev": "npm run compile:dev",
"package:dev": "npm run package:vsts-extension --vssconfig=dev",
"publish:dev": "npm run publish:vsts-extension --vssconfig=dev",
"build:ppe": "npm run compile",
"package:ppe": "npm run package:vsts-extension --vssconfig=ppe",
"publish:ppe": "npm run publish:vsts-extension --vssconfig=ppe",
"build:test": "npm run compile",
"package:test": "npm run package:vsts-extension --vssconfig=test",
"publish:test": "npm run publish:vsts-extension --vssconfig=test",
"build:prod": "npm run compile",
"package:prod": "npm run package:vsts-extension --vssconfig=prod",
"publish:prod": "npm run publish:vsts-extension --vssconfig=prod",
Expand Down

0 comments on commit 2123142

Please sign in to comment.