Skip to content

Commit

Permalink
auto build package with tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Kukks committed Nov 8, 2023
1 parent 8d359fb commit ff86808
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 193 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/delete-old-workflow-runs.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/publish-btcpay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create Release

on:
create:
tags:
- 'BTCPayServer/*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x' # Use .NET 7

- name: Run build script and capture output
run: |
chmod +x $GITHUB_WORKSPACE/build-btcpayplugin.sh
ASSET_PATH=$($GITHUB_WORKSPACE/build-btcpayplugin.sh | tail -1)
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
- name: Verify tag matches asset file name
run: |
TAG_NAME=${GITHUB_REF#refs/tags/BTCPayServer/}
ASSET_BASE_NAME=$(basename $ASSET_PATH .zip)
if [[ "$ASSET_BASE_NAME" != *"$TAG_NAME" ]]; then
echo "Error: Tag name does not match asset file name."
exit 1
fi
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ASSET_PATH }}
asset_name: $(basename ${{ env.ASSET_PATH }})
asset_content_type: application/zip
75 changes: 0 additions & 75 deletions .github/workflows/publish-nightly.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/publish-release.yml

This file was deleted.

16 changes: 16 additions & 0 deletions build-btcpayplugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Get the directory of the currently running script
StartPath=$(dirname "$0")

# Print the StartPath
echo "$StartPath"

# Build the project
dotnet build "$StartPath/src/Smartstore.Modules/Smartstore.BTCPayServer/Smartstore.BTCPayServer.csproj" -c Release

# Print the path to the PackagerCLI project
echo "$StartPath/tools/Smartstore.PackagerCLI/Smartstore.PackagerCLI.csproj"

# Run the PackagerCLI project
dotnet run --project "$StartPath/tools/Smartstore.PackagerCLI/Smartstore.PackagerCLI.csproj" "$StartPath/src/Smartstore.Web/Modules/Smartstore.BTCPayServer" "$StartPath/build/packages"
2 changes: 1 addition & 1 deletion src/Smartstore.Modules/Smartstore.BTCPayServer/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"SystemName": "Smartstore.BTCPayServer",
"FriendlyName": "Bitcoin payments with BTCPay Server",
"Description": "This plugin enables Bitcoin payments with your BTCPay Server instance",
"Version": "5.0.6.1",
"Version": "5.0.5",
"MinAppVersion": "5.0.5",
"Author": "Nisaba Solutions",
"Order": 1,
Expand Down
3 changes: 3 additions & 0 deletions tools/Smartstore.PackagerCLI/Smartstore.PackagerCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<Content Include="..\..\build-btcpayplugin.ps1">
<Link>build-btcpayplugin.ps1</Link>
</Content>
<Content Include="..\..\build-btcpayplugin.sh">
<Link>build-btcpayplugin.sh</Link>
</Content>
</ItemGroup>

</Project>

0 comments on commit ff86808

Please sign in to comment.