Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mickey-m0use committed Aug 16, 2023
0 parents commit 9af41c7
Show file tree
Hide file tree
Showing 41 changed files with 3,172 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
111 changes: 111 additions & 0 deletions .github/workflows/produce_vsix_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Build, pack and release

on:
push:
branches:
- master
paths:
- "**/*.cs"
- "**/*.csproj"
- "**/*.vsixmanifest"
- ".github/workflows/**"

concurrency:
group: proj-${{ github.head_ref }}
cancel-in-progress: true

jobs:

build_sign_vsix:
name: Build, pack and sign VSIX
runs-on: windows-latest
outputs:
release_ver: ${{ steps.proj_version.outputs.newVersion }}

steps:
- uses: actions/checkout@v3
- uses: nuget/setup-nuget@v1
- uses: microsoft/setup-msbuild@v1.1
with:
vs-version: '[17.0,18.0)'
msbuild-architecture: x64

- name: Parse project assembly version
id: proj_version
uses: vers-one/dotnet-project-version-updater@v1.3
with:
file: "VsixHexVisualizer/Properties/AssemblyInfo.cs"
version: '*.*.*.*'

- name: Download NuGet dependencies
run: nuget restore

- name: Build VSIX
id: build_vsix
run: msbuild .\HexVisualizer.sln /p:Configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal

- name: Upload unsigned VSIX
uses: actions/upload-artifact@v2
with:
name: uploaded_unsigned_vsix
path: .\build\VsixHexVisualizer\Release\VsixHexVisualizer.vsix

- name: Checkout private key repo
uses: actions/checkout@v3
with:
repository: ${{ secrets.KEYSTORE_GIT_REPOSITORY }}
token: ${{ secrets.KEYSTORE_ACCESS_TOKEN }}
path: .\private

- name: Sign VSIX
run: .\vsixsigntool.exe sign /f private\private.pfx /p ${{ secrets.PRIVATE_SIGN_KEY_PASSWORD }} /fd sha256 /v build\VsixHexVisualizer\Release\VsixHexVisualizer.vsix

- name: Upload signed VSIX
uses: actions/upload-artifact@v2
with:
name: uploaded_signed_vsix
path: .\build\VsixHexVisualizer\Release\VsixHexVisualizer.vsix

release:
name: Make Github release draft with built artifact
needs: build_sign_vsix
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BUILD_TOKEN }}
RELEASE_VERSION: ${{ needs.build_sign_vsix.outputs.release_ver }}

steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1

with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}
draft: true

- name: Download unsigned artifact
uses: actions/download-artifact@v2
with:
name: uploaded_unsigned_vsix

- name: Upload unsigned artifact to release assets
uses: actions/upload-release-asset@v1.0.1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: VsixHexVisualizer.vsix
asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}-unsigned.vsix
asset_content_type: application/zip

- name: Download signed artifact
uses: actions/download-artifact@v2
with:
name: uploaded_signed_vsix

- name: Upload signed artifact to release assets
uses: actions/upload-release-asset@v1.0.1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: VsixHexVisualizer.vsix
asset_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}-signed.vsix
asset_content_type: application/zip
Loading

0 comments on commit 9af41c7

Please sign in to comment.