Skip to content

Merge pull request #2 from AmadeusITGroup/feat/migrate-skill-eval-fra… #8

Merge pull request #2 from AmadeusITGroup/feat/migrate-skill-eval-fra…

Merge pull request #2 from AmadeusITGroup/feat/migrate-skill-eval-fra… #8

Workflow file for this run

name: Publish Package
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
publish-collections:
name: Publish Collection Releases
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
contents: write
packages: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Common setup
id: setup
uses: ./.github/actions/publish-common
- name: Fail if validation failed
if: steps.setup.outputs.validation-status == 'failure'
run: exit 1
- name: Fail if unit tests failed
if: steps.setup.outputs.test-status == 'failure'
run: exit 1
- name: Publish affected collections
# NOTE: github.event.before may be all zeros (0000000...) on the first push to a
# branch or after a force-push. The publish script handles this by falling back
# to HEAD~1 if it exists, or returning no changed paths for an initial commit
# (which skips publishing).
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_BASE_SHA: ${{ github.event.before }}
GITHUB_HEAD_SHA: ${{ github.sha }}
run: |
npx publish-collections
publish-preview:
name: Preview Collection Releases (PR)
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
contents: read
packages: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Save PR number
run: echo "${{ github.event.pull_request.number }}" > pr-number.txt
- name: Common setup
id: setup
uses: ./.github/actions/publish-common
- name: Post validation results to PR
uses: ./.github/actions/pr-comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-path: validation-comment.md
comment-tag: collection-validation
- name: Fail if validation failed
if: steps.setup.outputs.validation-status == 'failure'
run: exit 1
- name: Fail if unit tests failed
if: steps.setup.outputs.test-status == 'failure'
run: exit 1
- name: Preview affected collections (dry-run)
env:
GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
npx publish-collections --dry-run
- name: Upload preview artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: pr-preview-dist
path: |
dist/
if-no-files-found: ignore