Package prism #15
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will download the nodejs based prism-cli | |
| # which this program uses for its tests | |
| name: Package prism | |
| env: | |
| TAR_REPRO_OPTS: '"--mtime=2024-01-01 00:00 UTC" --sort=name --owner=0 --group=0 --numeric-owner' | |
| TAR_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}-prism.tar.gz | |
| TAR_FILES: node_modules package.json package-lock.json cloudflare-spec.yml | |
| CHECKOUT_DIR: ${{ github.event.repository.name }}-${{ github.ref_name }} | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| vendor-tarball: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: ${{ env.CHECKOUT_DIR }} | |
| - name: Set up node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "latest" | |
| - name: fetch Prism and deps | |
| run: npm install $(grep -m1 prism-cli scripts/mock | awk '{print $3}' | sed s/--package=//) | |
| working-directory: ${{ env.CHECKOUT_DIR }} | |
| # The spec is under a BSD license see https://github.com/cloudflare/api-schemas | |
| # upstream fetches this at test time in scripts/mock | |
| - name: fetch cloudflare api spec | |
| run: wget $(yq -e '.openapi_spec_url' .stats.yml) -O cloudflare-spec.yml | |
| working-directory: ${{ env.CHECKOUT_DIR }} | |
| - name: Create Archive | |
| run: tar ${{ env.TAR_REPRO_OPTS }} -caf ${{ env.TAR_NAME }} ${{ env.TAR_FILES }} | |
| working-directory: ${{ env.CHECKOUT_DIR }} | |
| - name: release | |
| run: | | |
| gh release create ${{ github.ref_name }} \ | |
| --title "${{ github.ref_name }}" \ | |
| --notes "Prism tarball for tests for Gentoo Linux overlay package" \ | |
| ${{ env.TAR_NAME }} | |
| working-directory: ${{ env.CHECKOUT_DIR }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |