Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
sshh12 committed Sep 7, 2024
1 parent 71e5e6f commit d03f575
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/nina-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is a sample github action to build and release your plugin using a github action
# It will run when pushing a new tag - the tag name must be your plugin version number (e.g. "1.0.0.0")
# Replace and adjust the areas that are commented below
# Place it into the workflow folder of your repository at .github/workflows
name: Build and Release

# Every time a new tag with the typical assembly format is pushed this will run. e.g. tag name "1.0.0.0"
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write

env:
# Adjust this to your plugin title
PLUGIN_NAME: "AstroHTTPAPI"
PLUGIN_DLL_NAME: "Plugin.NINA.AstroAppHTTPAPI"

jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# In case you need more sub folders add these here
- name: Prepare folders
run: |
mkdir packages
mkdir packages/${{ env.PLUGIN_NAME }}
# This will build your solution. If the solution name differs from your plugin name, please adjust it here
- name: Build .NET Assemblies
run: |
dotnet restore
dotnet build ${{ env.PLUGIN_NAME }}.sln -c Release -p:PostBuildEvent= -p:Version=${{ github.ref_name }}
# If you have mkdocs documentation you want to include, you can uncomment and build it like this
# - name: Build Documentation
# run: |
# python -m pip install --upgrade pip
# pip install mkdocs
# pip install mkdocs-material
# mkdocs build -f ${{ env.PLUGIN_NAME }}\docs\mkdocs.yml


# Add all necessary files that the plugin needs to the packages folder - basically all items that are normally in your post build event on your local builds
- name: Prepare package
run: |
Copy-Item "bin/Release/net8.0-windows8.0/${{ env.PLUGIN_DLL_NAME }}.dll" "packages/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_DLL_NAME }}.dll" -Force
Copy-Item "bin/Release/net8.0-windows8.0/${{ env.PLUGIN_DLL_NAME }}.pdb" "packages/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_DLL_NAME }}.pdb" -Force
- name: Create Plugin archives and manifests
run: |
curl https://api.bitbucket.org/2.0/repositories/isbeorn/nina.plugin.manifests/src/main/tools/CreateNET7Manifest.ps1 >> CreateNET7Manifest.ps1
pwsh CreateNET7Manifest.ps1 -file packages/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_DLL_NAME }}.dll -installerUrl https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/${{ env.PLUGIN_DLL_NAME }}.${{ github.ref_name }}.zip -createArchive -includeAll -appendVersionToArchive
Rename-Item -Path "manifest.json" -NewName "${{ env.PLUGIN_DLL_NAME }}.${{ github.ref_name }}.manifest.json"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
files: |
./${{ env.PLUGIN_DLL_NAME }}.${{ github.ref_name }}.zip
./${{ env.PLUGIN_DLL_NAME }}.${{ github.ref_name }}.manifest.json

0 comments on commit d03f575

Please sign in to comment.