This repo includes the following actions:
This repo uses pnpm.
For more detailed explanations see the respective readmes. Nevertheless here's a minimal example of these actions in use.
- id: version-metadatauses: Quantco/ui-actions/version-metadata@v1with:
file: lib/package.jsontoken: ${{ secrets.GITHUB_TOKEN }}
- name: Determine last published versionrun: | set +e # disable pipefail, error handling is done manually below # get version or fall back to `0.0.0` if the package doesn't exist (yet) echo "CI_PUBLISHED_VERSION=$(npm show <YOUR PACKAGE NAME> version || echo "0.0.0")" >> $GITHUB_ENVenv:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: publishuses: Quantco/ui-actions/publish@v1with:
increment-type: pre-releaserelevant-files: '[".github/**", "lib/**"]'package-json-file-path: lib/package.jsonlatest-registry-version: ${{ env.CI_PUBLISHED_VERSION }}version-metadata-json: ${{ steps.version-metadata.outputs.json }}
- name: publish npm packageif: steps.publish.outputs.publish == 'true'run: | echo "Publishing version ${{ steps.publish.outputs.version }}" npm version --git-tag-version false --allow-same-version true ${{ steps.publish.outputs.version }} npm publishenv:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create action summaryrun: | echo "$SUMMARY" >> $GITHUB_STEP_SUMMARYenv:
SUMMARY: ${{ steps.publish.outputs.reason }}ui-actions uses ui-actions itself for creating git tags based on the version in the package.json files (see .github/workflows/build.yml).
Whenever you want to release a new version you just have to increment the version number in bothpublish/package.json and version-metadata/package.json.
For local testing you can use the test.sh files.