Skip to content

Commit 6d99c4f

Browse files
authored
Test ci 2 (#23)
* docs: append additional line to testreleaseprocess.md * docs: clean up release.md - remove duplicates and clarify workflow * docs: remove outdated CLI release docs Delete cli/docs/release.md and cli/docs/testreleaseprocess.md which were redundant/outdated. * chore: update cli/.goreleaser.yml — add archive format/name_template, fix LICENSE path, remove snapshot template * chore: normalize working-directory and fix paths in release workflow and goreleaser config - Set default shell to bash and remove global working-directory; specify working-directory per step - Run dashboard build, git tagging and goreleaser release from cli directory - Update azd publish to use repository registry.json and cli/dist artifact paths - Adjust cli/.goreleaser.yml file patterns to reference LICENSE and cli/* paths correctly * chore: remove duplicate GITHUB_TOKEN env entry in release workflow * chore: refine release workflow, fix GoReleaser config, add test script - .github/workflows/release-please.yml: normalize PR title/commit to include "v", expand PR body with current/new version and release type, add next-steps, and use branch name release/v{version} - cli/.goreleaser.yml: use Windows-friendly hook, remove hardcoded archive format (use overrides), correct dashboard dist path to cli/src/internal/dashboard/dist, ensure dir set for build - add test-release.ps1: PowerShell helper to build dashboard and run goreleaser in snapshot mode for local testing * chore: remove redundant GoReleaser 'before' hook (dashboard built in workflow) * chore: align goreleaser config with cli working dir, update release workflow, add cli .gitignore - Copy LICENSE into cli in the release workflow and pass -f .goreleaser.yml to goreleaser - Remove redundant dir: cli and strip cli/ prefixes in cli/.goreleaser.yml so asset paths are relative - Add cli/.gitignore to ignore copied LICENSE and generated dist/ artifacts * chore: remove working-directory from Create git tag step in release workflow * chore: install azd extensions in release workflow before registry update * chore: add MIT License to cli and remove LICENSE ignore from .gitignore * chore: remove LICENSE copy step from release workflow * chore: run azd x publish from cli and fix registry/artifacts paths in release workflow * chore: enable GitHub releases in cli/.goreleaser.yml (add owner/name, name_template, draft and prerelease) * chore: pass tag-style version (v$VERSION) to azd x publish in release workflow * chore(release): switch to azd x release flow; remove release-please & goreleaser - Replace prepare/publish split with a single bump-based release workflow (.github/workflows/release.yml) - workflow now computes next version, updates cli/extension.yaml & CHANGELOG.md, commits bump - builds, packs, creates release and publishes using azd x (azd x build/pack/release/publish) - removed goreleaser steps and manual tag handling - Remove release-please and goreleaser artifacts: - deleted .github/workflows/release-please.yml, .release-please-manifest.json, release-please-config.json - deleted cli/.goreleaser.yml and legacy test-release.ps1 - Update docs to reflect new automated azd x process (cli/docs/dev/release.md) - Add local test helper script cli/scripts/test-azd-x-flow.ps1 to simulate the azd x release flow
1 parent 01670c2 commit 6d99c4f

File tree

8 files changed

+881
-504
lines changed

8 files changed

+881
-504
lines changed

.github/workflows/release-please.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 85 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,86 @@ name: Release
33
on:
44
workflow_dispatch:
55
inputs:
6-
version:
7-
description: 'Version to release (e.g., 0.2.1)'
6+
bump:
7+
description: 'Version bump type'
88
required: true
9-
type: string
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
1014

1115
defaults:
1216
run:
1317
shell: bash
1418

1519
jobs:
16-
build-and-release:
20+
release:
1721
runs-on: ubuntu-latest
1822
permissions:
1923
contents: write
2024

2125
steps:
22-
- name: Checkout code
26+
- name: Checkout
2327
uses: actions/checkout@v4
2428
with:
2529
fetch-depth: 0
2630

27-
- name: Set up Go
28-
uses: actions/setup-go@v5
29-
with:
30-
go-version: '1.23'
31-
cache-dependency-path: cli/go.sum
31+
- name: Calculate next version
32+
id: version
33+
run: |
34+
CURRENT=$(grep '^version:' cli/extension.yaml | awk '{print $2}')
35+
IFS='.' read -r major minor patch <<< "$CURRENT"
36+
37+
case "${{ inputs.bump }}" in
38+
major)
39+
major=$((major + 1))
40+
minor=0
41+
patch=0
42+
;;
43+
minor)
44+
minor=$((minor + 1))
45+
patch=0
46+
;;
47+
patch)
48+
patch=$((patch + 1))
49+
;;
50+
esac
51+
52+
NEXT="$major.$minor.$patch"
53+
echo "current=$CURRENT" >> $GITHUB_OUTPUT
54+
echo "next=$NEXT" >> $GITHUB_OUTPUT
55+
echo "Bumping from $CURRENT to $NEXT"
56+
57+
- name: Update version files
58+
run: |
59+
VERSION="${{ steps.version.outputs.next }}"
60+
61+
# Update extension.yaml
62+
sed -i "s/^version: .*/version: $VERSION/" cli/extension.yaml
63+
64+
# Update CHANGELOG.md
65+
cd cli
66+
PREV="${{ steps.version.outputs.current }}"
67+
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges v${PREV}..HEAD 2>/dev/null || git log --pretty=format:"- %s (%h)" --no-merges -n 10)
68+
DATE=$(date +%Y-%m-%d)
69+
70+
{
71+
echo "## [$VERSION] - $DATE"
72+
echo ""
73+
echo "$COMMITS"
74+
echo ""
75+
cat CHANGELOG.md
76+
} > CHANGELOG.new.md
77+
mv CHANGELOG.new.md CHANGELOG.md
78+
79+
# Commit version bump
80+
cd ..
81+
git config user.name "github-actions[bot]"
82+
git config user.email "github-actions[bot]@users.noreply.github.com"
83+
git add cli/extension.yaml cli/CHANGELOG.md
84+
git commit -m "chore: bump version to $VERSION"
85+
git push
3286
3387
- name: Set up Node.js
3488
uses: actions/setup-node@v4
@@ -37,58 +91,49 @@ jobs:
3791
cache: 'npm'
3892
cache-dependency-path: cli/dashboard/package-lock.json
3993

94+
- name: Install azd
95+
run: curl -fsSL https://aka.ms/install-azd.sh | bash
96+
97+
- name: Install azd extensions
98+
run: azd extension install microsoft.azd.extensions
99+
40100
- name: Build dashboard
41101
run: |
42102
cd cli/dashboard
43103
npm ci
44104
npm run build
45105
46-
- name: Create git tag
106+
- name: Build binaries
47107
run: |
48-
git config user.name "github-actions[bot]"
49-
git config user.email "github-actions[bot]@users.noreply.github.com"
50-
git tag -a "v${{ inputs.version }}" -m "Release v${{ inputs.version }}"
51-
git push origin "v${{ inputs.version }}"
52-
working-directory: cli
108+
export EXTENSION_ID="jongio.azd.app"
109+
export EXTENSION_VERSION="${{ steps.version.outputs.next }}"
110+
azd x build --all --cwd cli
53111
54-
- name: Install GoReleaser
55-
uses: goreleaser/goreleaser-action@v6
56-
with:
57-
distribution: goreleaser
58-
version: latest
59-
install-only: true
112+
- name: Package
113+
run: azd x pack --cwd cli
60114

61-
- name: Build binaries and create release
62-
run: goreleaser release --clean -f .goreleaser.yml
115+
- name: Release
116+
run: |
117+
azd x release \
118+
--cwd cli \
119+
--repo "${{ github.repository }}" \
120+
--version "${{ steps.version.outputs.next }}" \
121+
--confirm
63122
env:
64123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65-
working-directory: cli
66-
67-
- name: Install azd CLI
68-
run: |
69-
curl -fsSL https://aka.ms/install-azd.sh | bash
70-
71-
- name: Install azd extensions
72-
run: |
73-
azd extension install microsoft.azd.extensions
74124

75125
- name: Update registry
76126
run: |
77-
VERSION="${{ inputs.version }}"
78-
79127
azd x publish \
80128
--cwd cli \
81129
--registry ../registry.json \
82-
--version "v$VERSION" \
83-
--artifacts "dist/*.zip,dist/*.tar.gz" \
84-
--repo "${{ github.repository }}"
130+
--version "${{ steps.version.outputs.next }}"
85131
86-
# Commit registry.json back to main
87132
git config user.name "github-actions[bot]"
88133
git config user.email "github-actions[bot]@users.noreply.github.com"
89134
git add registry.json
90135
if ! git diff --cached --quiet; then
91-
git commit -m "chore: update registry.json for v$VERSION"
136+
git commit -m "chore: update registry for v${{ steps.version.outputs.next }}"
92137
git push
93138
fi
94139
env:

.release-please-manifest.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

cli/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# GoReleaser artifacts
1+
# Build artifacts
2+
bin/
23
dist/

cli/.goreleaser.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)