forked from keptn-sandbox/keptn-azure-devops-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add release automation (keptn-sandbox#80)
Adds pre-release and release workflow. Packaged extension is added to both prerelease and release as an asset. Prerelease workflow will package the dev extension while releases will package the public extension Signed-off-by: Paolo Chila <[email protected]>
- Loading branch information
Showing
6 changed files
with
70 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,10 +2,6 @@ | |
name: 'Unit Tests' | ||
description: 'Run unit tests using Node.js' | ||
inputs: | ||
NODE_VERSION: | ||
default: "14" | ||
description: "NodeJS version to be used for the test run" | ||
required: false | ||
KEPTN_API_ENDPOINT: | ||
default: "" | ||
description: "Keptn API endpoint to be used for test run" | ||
|
@@ -16,11 +12,11 @@ inputs: | |
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
steps: | ||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{inputs.NODE_VERSION}} | ||
node-version: 14 | ||
- name: Install tsc | ||
shell: bash | ||
run: npm install [email protected] | ||
|
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 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,33 @@ | ||
name: Create Pre-Release | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: Unit tests | ||
uses: ./.github/actions/unit-tests | ||
|
||
pre-release: | ||
needs: test | ||
name: Pre-Release | ||
uses: keptn/gh-automation/.github/workflows/[email protected] | ||
|
||
package-dev-extension: | ||
needs: [pre-release] | ||
name: "Package DEV extension" | ||
runs-on: ubuntu-20.04 | ||
env: | ||
VERSION: ${{ needs.pre-release.outputs.RELEASE_TAG }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PRE_RELEASE_SEPARATOR: "next" | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- run: | | ||
npm install | ||
# transform x.y.z-next.{prerelease} into x.y.z.{prerelease} for packaging and publishing the extension as per Microsoft requirements | ||
AZDO_EXT_VERSION=$(echo ${VERSION} | sed 's/-${{env.PRE_RELEASE_SEPARATOR}}\(\.[[:digit:]]\+\)$/\1/g') npm run package-dev | ||
gh release upload "${VERSION}" *.vsix |
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,32 @@ | ||
name: Create Release | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: Unit tests | ||
uses: ./.github/actions/unit-tests | ||
|
||
release: | ||
needs: test | ||
name: Release | ||
uses: keptn/gh-automation/.github/workflows/[email protected] | ||
|
||
package-dev-extension: | ||
needs: [release] | ||
name: "Package PUBLIC extension" | ||
runs-on: ubuntu-20.04 | ||
env: | ||
VERSION: ${{ needs.release.outputs.RELEASE_TAG }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
AZDO_EXT_VERSION: ${{ needs.release.outputs.RELEASE_TAG }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- run: | | ||
npm install | ||
npm run package | ||
gh release upload "${VERSION}" *.vsix |
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 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