This project is a TypeScript action that can be used in GitHub Actions workflows.
Calculates the next versions for prod and beta releases
- Written in TypeScript for type safety and improved development experience
- Includes compilation support, tests, a validation workflow, publishing, and versioning guidance
- Can be easily customized and extended to suit specific use cases
- Integrates seamlessly with GitHub Actions workflows
To use this action in your own workflows, you can reference it using the uses
syntax in your workflow YAML file. For example:
- name: Calculate new versions
id: new-versions
uses: themoneyplatform/version-action@v1
with:
release-level: ${{ steps.analyse-commits.outputs.release-level }}
latest-production-version: ${{ steps.get-latest-semver-tag.latest-prod-tag }}
latest-beta-version: ${{ steps.get-latest-semver-tag.latest-beta-tag }}
To run the action locally, follow these steps:
-
Clone the repository:
git clone https://github.com/themoneyplatform/version-action.git
-
Install the dependencies:
npm install
-
Build the TypeScript code:
npm run build
-
Run the action:
node dist/index.js
To run the tests for this action, use the following command:
npm test
This will execute the test suites defined in the __tests__
directory.
To build and package the action for distribution, use the following command:
npm run package
This will compile the TypeScript code and package the action into a single distributable file.
If you encounter any issues while using this action, please refer to the following troubleshooting tips:
- Make sure you have the latest version of the action installed
- Ensure that your workflow YAML file is properly formatted and contains the correct syntax
- Double-check that you have provided the necessary input parameters to the action
- If the issue persists, please open an issue on the GitHub repository with detailed information about the problem you're facing
For more detailed information and advanced usage examples, please refer to the GitHub repository's documentation.
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Test Local Action
id: test-action
uses: actions/typescript-action@v1 # Commit with the `v1` tag
with:
milliseconds: 1000
- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
This project includes a helper script, script/release
designed to streamline the process of tagging and pushing new releases for
GitHub Actions.
GitHub Actions allows users to select a specific version of the action to use, based on release tags. This script simplifies this process by performing the following steps:
- Retrieving the latest release tag: The script starts by fetching the most recent release tag by looking at the local data available in your repository.
- Prompting for a new release tag: The user is then prompted to enter a new release tag. To assist with this, the script displays the latest release tag and provides a regular expression to validate the format of the new tag.
- Tagging the new release: Once a valid new tag is entered, the script tags the new release.
- Pushing the new tag to the remote: Finally, the script pushes the new tag to the remote repository. From here, you will need to create a new release in GitHub and users can easily reference the new tag in their workflows.