Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
frasdav committed Dec 19, 2023
1 parent e47db76 commit 85f1c1f
Show file tree
Hide file tree
Showing 23 changed files with 14,394 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,json}]
indent_size = 2
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: 'airbnb-base',
rules: {
'linebreak-style': ['error', (process.platform === 'win32' ? 'windows' : 'unix')],
},
};
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: build

on:
workflow_call:
inputs:
version:
required: false
default: "0.0.0"
type: string
outputs:
is_pre_release:
value: ${{ jobs.build.outputs.is_pre_release }}
node_version:
value: ${{ jobs.build.outputs.node_version }}
tfx_cli_version:
value: ${{ jobs.build.outputs.tfx_cli_version }}
vsix_file_name:
value: ${{ jobs.build.outputs.vsix_file_name }}

jobs:
build:
runs-on: ubuntu-latest
outputs:
is_pre_release: ${{ steps.build.outputs.is_pre_release }}
node_version: ${{ steps.get_node_version.outputs.node_version }}
tfx_cli_version: ${{ steps.get_tfx_cli_version.outputs.tfx_cli_version }}
vsix_file_name: ${{ steps.build.outputs.vsix_file_name }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- run: npm ci
- run: npm test
- id: build
run: npm run build "${{ inputs.version }}" "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v3
with:
name: dist
path: "${{ github.workspace }}/dist/"
if-no-files-found: error
- id: get_node_version
run: |
node_version=$(cat "${GITHUB_WORKSPACE}/.nvmrc")
echo "node_version=${node_version}" >> "$GITHUB_OUTPUT"
- id: get_tfx_cli_version
run: |
tfx_cli_version=$(cat "${GITHUB_WORKSPACE}/package.json" | jq -r ".dependencies[\"tfx-cli\"]")
echo "tfx_cli_version=${tfx_cli_version}" >> "$GITHUB_OUTPUT"
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: CI

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
build:
uses: ./.github/workflows/build.yml
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: Release

on:
push:
tags:
- "*"

jobs:
preflight:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- id: get_version
run: echo "version=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
build:
uses: ./.github/workflows/build.yml
needs: preflight
with:
version: ${{ needs.preflight.outputs.version }}
release:
runs-on: ubuntu-latest
needs:
- preflight
- build
steps:
- uses: actions/download-artifact@v3
id: download
with:
name: dist
path: ${{ github.workspace }}
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: ${{ needs.build.outputs.is_pre_release }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "${{ github.workspace }}/${{ needs.build.outputs.vsix_file_name }}"
asset_name: ${{ needs.build.outputs.vsix_file_name }}
asset_content_type: application/gzip
publish:
runs-on: ubuntu-latest
needs:
- preflight
- build
environment: visual-studio-marketplace
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ needs.build.outputs.node_version }}
- run: npm install -g "tfx-cli@${{ needs.build.outputs.tfx_cli_version }}"
- uses: actions/download-artifact@v3
id: download
with:
name: dist
path: ${{ github.workspace }}
- run: |
npx tfx-cli extension publish \
--vsix "${GITHUB_WORKSPACE}/${{ needs.build.outputs.vsix_file_name }}" \
--service-url https://marketplace.visualstudio.com \
--token "${{ secrets.VISUAL_STUDIO_MARKETPLACE_TOKEN }}" \
--share-with "${{ secrets.VISUAL_STUDIO_MARKETPLACE_PUBLISHER }}"
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ide
.env
.vscode

# node
node_modules

# other
.taskkey
dist/
test-results.xml
*.vsix
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# sheriff-azure-devops-extension
# sheriff-azure-devops-extension
Empty file added SUPPORT.md
Empty file.
Binary file added images/extension-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 85f1c1f

Please sign in to comment.