name: Pack on: workflow_call: inputs: version: description: The version the packages are packed at required: true type: string set-version: description: Set the manifests to `version` first (the dry run); a release's tag already matches them default: false type: boolean artifact: description: The name of the artifact the packages are uploaded as default: packages type: string permissions: contents: read jobs: pack: name: Pack every package runs-on: ubuntu-latest timeout-minutes: 20 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: $/.github/actions/rust with: cache: "false" cache-key: release - uses: $/.github/actions/pnpm - name: Set the manifests to the version if: inputs.set-version env: VERSION: ${{ inputs.version }} run: | cargo fetch --locked node scripts/release.ts set-version "$VERSION" - name: Pack the crates and the npm package env: VERSION: ${{ inputs.version }} ALLOW_DIRTY: ${{ inputs.set-version && '--allow-dirty' || '' }} run: | mkdir -p "$RUNNER_TEMP/packages" crates=$(node scripts/release.ts crates) cargo package $(printf -- '-p %s ' $crates) --locked --no-verify $ALLOW_DIRTY for crate in $crates; do cp "target/package/$crate-$VERSION.crate" "$RUNNER_TEMP/packages/"; done (cd packages/ferrovue && pnpm pack --pack-destination "$RUNNER_TEMP/packages") test -f "$RUNNER_TEMP/packages/ferrovue-$VERSION.tgz" (cd "$RUNNER_TEMP/packages" && sha256sum -- * | tee -a "$GITHUB_STEP_SUMMARY") - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: ${{ inputs.artifact }} path: ${{ runner.temp }}/packages/ if-no-files-found: error retention-days: 14