Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
timheuer committed Nov 30, 2023
0 parents commit 61a0891
Show file tree
Hide file tree
Showing 20 changed files with 1,067 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
58 changes: 58 additions & 0 deletions .github/workflows/_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Base build"

on:
workflow_call:
outputs:
version:
description: 'Version of the build'
value: ${{ jobs.build.outputs.version }}
workflow_dispatch:
inputs:
Reason:
description: 'Reason for the build'

jobs:
build:
outputs:
version: ${{ steps.vsix_version.outputs.SimpleVersion }}
name: Build
runs-on: windows-2022
env:
PROJECT_PATH: "src/AspireManifestGen.sln"

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Version stamping
id: vsix_version
uses: dotnet/nbgv@e6830c173ef6061fe122d7205ac31bb2f8cca842
with:
setAllVars: true

- name: 🧰 Setup .NET build dependencies
uses: timheuer/bootstrap-dotnet@v1
with:
nuget: 'false'
sdk: 'false'
msbuild: 'true'

- name: 🏗️ Build
run: msbuild ${{ env.PROJECT_PATH }} /p:Configuration=Release /v:m -restore /p:OutDir=\_built -bl

- name: ⬆️ Upload artifact
uses: actions/upload-artifact@v3
with:
name: msbuild.binlog
path: msbuild.binlog

- name: ⬆️ Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}.vsix
path: /_built/**/*.vsix

- name: Echo version
run: |
Write-Output ${{ steps.vsix_version.outputs.SimpleVersion }}
15 changes: 15 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Build PR"

on:
pull_request:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
- '**/*.gitattributes'

jobs:
build:
name: Build and Test
uses: ./.github/workflows/_build.yaml
55 changes: 55 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Publish"

on: workflow_dispatch

jobs:
build:
name: Build and Test
uses: ./.github/workflows/_build.yaml

publish:
needs: build
environment:
name: production
url: https://marketplace.visualstudio.com/items?itemName=TimHeuer.AspireManifestGen
name: Publish
runs-on: windows-2022
permissions:
contents: write

env:
VERSION: ${{ needs.build.outputs.version }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Package artifact
uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}.vsix

- name: Upload to VsixGallery
uses: timheuer/openvsixpublish@v1
with:
vsix-file: ${{ github.event.repository.name }}.vsix

- name: Publish extension to Marketplace
#if: ${{ contains(github.event.head_commit.message, '[release]') }}
uses: cezarypiatek/[email protected]
with:
extension-file: '${{ github.event.repository.name }}.vsix'
publish-manifest-file: 'vs-publish.json'
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}

- name: Tag and Release
id: tag_release
uses: softprops/action-gh-release@v1
with:
body: Release ${{ env.VERSION }}
tag_name: ${{ env.VERSION }}
generate_release_notes: true
files: |
**/*.vsix
Loading

0 comments on commit 61a0891

Please sign in to comment.