Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Build and Publish Docker Image

on:
workflow_run:
workflows: [Release]
types:
- completed
release:
types: [published]

permissions:
id-token: write
Expand All @@ -18,9 +16,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Get semver without "v"
- name: Extract version (without v)
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
run: |
if [ "${{ github.event_name }}" = "release" ]; then
# Extract version from release tag (remove any 'v' prefix)
VERSION="${{ github.event.release.tag_name }}"
VERSION=${VERSION#v} # Remove 'v' prefix if present
else
VERSION="${{ github.event.inputs.version }}"
VERSION=${VERSION#v} # Remove 'v' prefix if present
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Syncing version: $VERSION"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -40,7 +49,7 @@ jobs:
with:
images: tragiccode/busly-cli
tags: |
${{ steps.version.outputs.VERSION }}
${{ steps.version.outputs.version }}
latest

- name: Build and push Docker image
Expand All @@ -50,7 +59,7 @@ jobs:
context: .
file: ./src/BuslyCLI.Console/Dockerfile
build-args: |
APP_VERSION=${{ steps.version.outputs.VERSION }}
APP_VERSION=${{ steps.version.outputs.version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/dotnet_tool_build.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/dotnet_tool_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Publish .NET Tool

on:
release:
types: [published]

jobs:
build-and-pack:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5

- name: Extract version (without v)
id: version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
# Extract version from release tag (remove any 'v' prefix)
VERSION="${{ github.event.release.tag_name }}"
VERSION=${VERSION#v} # Remove 'v' prefix if present
else
VERSION="${{ github.event.inputs.version }}"
VERSION=${VERSION#v} # Remove 'v' prefix if present
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Syncing version: $VERSION"

- name: Build and Pack as .NET tool
uses: devcontainers/[email protected]
with:
runCmd: |
dotnet cake --target Pack-DotNetTool --package-version ${{ steps.version.outputs.version }}

- name: Publish to NuGet (optional)
run: dotnet nuget push ./artifacts/nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
17 changes: 3 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ jobs:
version=$(grep -m 1 -oP '^##\s*\[\Kv[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md)
echo "version=$version" >> $GITHUB_OUTPUT

# - name: Create and push git tag
# run: |
# version=${{ steps.changelog.outputs.version }}

# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"

# git tag "v$version"
# git push origin "v$version"


# gh changelog new --latest
- name: "Generate Release Changelog"
run: |
Expand All @@ -44,12 +33,12 @@ jobs:
# This creates a tag but doesn't trigger a "push event of the tag" FYI
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_FOR_RELEASE_PUBLISH }}
with:
tag_name: ${{ steps.changelog.outputs.version }}
release_name: Release ${{ steps.changelog.outputs.version }}
name: Release ${{ steps.changelog.outputs.version }}
draft: false
prerelease: false
body_path: CHANGELOG.md