Skip to content

tweak

tweak #8

Workflow file for this run

# 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: "AstroAppHTTPAPI"
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 AstroAppHTTPAPI
dotnet build AstroAppHTTPAPI/${{ env.PLUGIN_NAME }}.sln -c Release -p:PostBuildEvent= -p:Version=${{ github.ref_name }}
# 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 "AstroAppHTTPAPI/bin/Release/net8.0-windows/${{ env.PLUGIN_DLL_NAME }}.dll" "packages/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_DLL_NAME }}.dll" -Force
Copy-Item "AstroAppHTTPAPI/bin/Release/net8.0-windows/${{ env.PLUGIN_DLL_NAME }}.pdb" "packages/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_DLL_NAME }}.pdb" -Force
curl https://raw.githubusercontent.com/sshh12/astro-app-nina-api/main/bins/EmbedIO.dll -o "packages/${{ env.PLUGIN_NAME }}/EmbedIO.dll"
curl https://raw.githubusercontent.com/sshh12/astro-app-nina-api/main/bins/Swan.Lite.dll -o "packages/${{ env.PLUGIN_NAME }}/Swan.Lite.dll"
- 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