mirror of
https://github.com/github/awesome-copilot.git
synced 2026-05-01 12:45:56 +00:00
* Updating the workflow to publish to the new marketplace branch Using env vars for the branch names so that we can easily update without inlining everything as we progress through * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
name: Publish distribution branches
|
|
|
|
on:
|
|
push:
|
|
branches: [staged]
|
|
|
|
env:
|
|
SOURCE_BRANCH: staged
|
|
LEGACY_PUBLISHED_BRANCH: main
|
|
MARKETPLACE_BRANCH: marketplace
|
|
WEBSITE_DEPLOY_REF: main
|
|
|
|
concurrency:
|
|
group: publish-distribution-branches
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
actions: write
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source branch
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
ref: ${{ env.SOURCE_BRANCH }}
|
|
fetch-depth: 0
|
|
|
|
- name: Extract Node version from package.json
|
|
id: node-version
|
|
run: |
|
|
NODE_VERSION=$(jq -r '.engines.node // "22"' package.json)
|
|
echo "version=${NODE_VERSION}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version: ${{ steps.node-version.outputs.version }}
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Materialize plugin files
|
|
run: node eng/materialize-plugins.mjs
|
|
|
|
- name: Build generated files
|
|
run: npm run build
|
|
|
|
- name: Fix line endings
|
|
run: bash eng/fix-line-endings.sh
|
|
|
|
- name: Publish to distribution branches
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add -A
|
|
git add -f plugins/*/agents/ plugins/*/skills/
|
|
git commit -m "chore: publish from ${SOURCE_BRANCH}" --allow-empty
|
|
git push origin --force --atomic HEAD:${LEGACY_PUBLISHED_BRANCH} HEAD:${MARKETPLACE_BRANCH}
|
|
|
|
- name: Dispatch website deployment
|
|
run: gh workflow run deploy-website.yml --ref "${WEBSITE_DEPLOY_REF}"
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|