Skip to content
Merged
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
23 changes: 18 additions & 5 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
required: false
type: number

defaults:
run:
working-directory: cli

env:
GO_VERSION: '1.26.0'

Expand Down Expand Up @@ -194,6 +198,7 @@ jobs:

- name: Calculate PR version
id: version
working-directory: cli
run: |
BASE_VERSION=$(grep '^version:' extension.yaml | awk '{print $2}')
PR_NUMBER="${{ steps.pr.outputs.number }}"
Expand All @@ -213,20 +218,24 @@ jobs:
azd extension install microsoft.azd.extensions --source azd

- name: Update extension.yaml with PR version
working-directory: cli
run: |
VERSION="${{ steps.version.outputs.version }}"
sed -i "s/^version: .*/version: ${VERSION}/" extension.yaml

- name: Build binaries
working-directory: cli
run: |
export EXTENSION_ID="jongio.azd.copilot"
export EXTENSION_VERSION="${{ steps.version.outputs.version }}"
azd x build --all

- name: Package
working-directory: cli
run: azd x pack

- name: Create PR pre-release
working-directory: cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -246,6 +255,7 @@ jobs:
~/.azd/registry/jongio.azd.copilot/${VERSION}/*

- name: Update registry
working-directory: cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -269,7 +279,7 @@ jobs:
SHORT_COMMIT=$(echo $COMMIT | cut -c1-7)
BRANCH="${{ github.ref_name }}"

cat > instructions.md <<EOF
cat > ../instructions.md <<EOF
## 🚀 Test This PR

A preview build (\`$VERSION\`) is ready for testing!
Expand All @@ -278,24 +288,24 @@ jobs:

**PowerShell (Windows):**
\`\`\`powershell
iex "& { \$(irm https://raw.githubusercontent.com/$REPO/$BRANCH/scripts/install-pr.ps1) } -PrNumber $PR_NUM -Version $VERSION"
iex "& { \$(irm https://raw.githubusercontent.com/$REPO/$BRANCH/cli/scripts/install-pr.ps1) } -PrNumber $PR_NUM -Version $VERSION"
\`\`\`

**Bash (macOS/Linux):**
\`\`\`bash
curl -fsSL https://raw.githubusercontent.com/$REPO/$BRANCH/scripts/install-pr.sh | bash -s $PR_NUM $VERSION
curl -fsSL https://raw.githubusercontent.com/$REPO/$BRANCH/cli/scripts/install-pr.sh | bash -s $PR_NUM $VERSION
\`\`\`

### Uninstall

**PowerShell (Windows):**
\`\`\`powershell
iex "& { \$(irm https://raw.githubusercontent.com/$REPO/$BRANCH/scripts/uninstall-pr.ps1) } -PrNumber $PR_NUM"
iex "& { \$(irm https://raw.githubusercontent.com/$REPO/$BRANCH/cli/scripts/uninstall-pr.ps1) } -PrNumber $PR_NUM"
\`\`\`

**Bash (macOS/Linux):**
\`\`\`bash
curl -fsSL https://raw.githubusercontent.com/$REPO/$BRANCH/scripts/uninstall-pr.sh | bash -s $PR_NUM
curl -fsSL https://raw.githubusercontent.com/$REPO/$BRANCH/cli/scripts/uninstall-pr.sh | bash -s $PR_NUM
\`\`\`

---
Expand Down Expand Up @@ -346,6 +356,9 @@ jobs:
if: github.event.action == 'closed' && github.event_name == 'pull_request_target'
permissions:
contents: write
defaults:
run:
working-directory: .

steps:
- name: Delete PR registry release
Expand Down
Loading