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
17 changes: 9 additions & 8 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Build and Publish Docker Image

on:
workflow_call:
inputs:
version:
required: true
type: string
push:
tags:
- 'v*'

permissions:
id-token: write
Expand All @@ -19,10 +17,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Get semver without "v"
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3


- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -38,7 +39,7 @@ jobs:
with:
images: tragiccode/busly-cli
tags: |
${{ inputs.version }}
${{ steps.version.outputs.VERSION }}
latest

- name: Build and push Docker image
Expand All @@ -48,7 +49,7 @@ jobs:
context: .
file: ./src/BuslyCLI.Console/Dockerfile
build-args: |
APP_VERSION=${{ inputs.version }}
APP_VERSION=${{ steps.version.outputs.VERSION }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/dotnet_tool_build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Build and Publish .NET Tool

on:
workflow_call:
inputs:
version:
required: true
type: string

push:
tags:
- 'v*'

jobs:
build-and-pack:
Expand All @@ -16,11 +13,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Get semver without "v"
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT

- name: Build and Pack as .NET tool
uses: devcontainers/ci@v0.3
with:
runCmd: |
dotnet cake --target Pack-DotNetTool --package-version ${{ inputs.version }}
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 }}
61 changes: 28 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,42 @@ permissions:
id-token: write
attestations: write


jobs:
get-version:
create-release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.changelog.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Extract version from CHANGELOG.md
id: changelog
run: |
version=$(grep -m 1 -oP '^##\s*\[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md)
echo "version=$version" >> $GITHUB_OUTPUT
tag:
needs: get-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Create and push git tag
# - 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"
- name: "Generate Release Changelog"
run: |
version=${{ needs.get-version.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"
docker:
needs: get-version
uses: ./.github/workflows/docker_build.yml
with:
version: ${{ needs.get-version.outputs.version }}
secrets: inherit

nuget:
needs: get-version
uses: ./.github/workflows/dotnet_tool_build.yml
with:
version: ${{ needs.get-version.outputs.version }}
secrets: inherit
gh extension install chelnak/gh-changelog
gh changelog new --latest

- name: Create GitHub 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
body_path: CHANGELOG.md
3 changes: 2 additions & 1 deletion .github/workflows/release_prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ on:
workflow_dispatch:
inputs:
version:
description: "The version number for the next release."
description: "The version number for the next release (e.g. 1.0.2)"
required: true

permissions:
contents: write
pull-requests: write
Expand Down
Loading