This action calculates the version to be used during a Pulumi provider build.
The calculated version is always valid semver 2.0.0 – with no leading "v".
- uses: pulumi/provider-version-action@v1
with:
# Optional name of the environment variable to set with the calculated version, for example: PROVIDER_VERSION
# Defaults to empty which results in no environment variable being set.
set-env: ''
Name | Description | Example |
---|---|---|
version |
The calculated version for the current build | 1.3.0-alpha.1577836800+699a10d |
Set the PROVIDER_VERSION
environment variable for use in any subsequent steps within the current job:
steps:
- uses: pulumi/provider-version-action@v1
with:
set-env: PROVIDER_VERSION
- name: Print version
run: echo "${PROVIDER_VERSION}"
Access the calculated version via the step's output:
steps:
- id: version
uses: pulumi/provider-version-action@v1
- name: Print version
run: echo "${{ steps.version.outputs.version }}"
Calculate the version once in a standalone job for all other jobs to reference:
jobs:
version:
runs-on: ubuntu-latest
steps:
- id: version
uses: pulumi/provider-version-action@v1
outputs:
version: ${{ steps.version.outputs.version }}
build:
runs-on: ubuntu-latest
needs: version
steps:
- name: Print version
run: echo "${{ needs.version.outputs.version }}"
This action supports 3 build scenarios:
v1.2.3
). The version from the tag will be used e.g. 1.2.3
1.2.3-alpha.1577836800
1.2.3-alpha.1577836800+699a10d
When we're wanting to build for a different major version from the last release, we can do this using three methods:
v1
or v7
). Pushing to this branch, or opening a pull request with this branch as the "base" will use this major version.upgrade-
and suffix -major
(e.g. upgrade-aws-to-v2.0.0-major
). This will cause the version number to be incremented by a major increment instead of a minor increment.needs-release/major
to a pull request. This will cause the version number to be incremented by a major increment instead of a minor increment.After a major version upgrade PR is merged, the next build of the default branch will also use the new major version.
Note: If both a version branch and a needs-release/major
label used, the version branch will take priority.
When building a branch or a pull-request, an alpha version will be generated with the following features:
2.43.0-alpha.1577836800+699a10d
| | | | | |
| | | | | ShortHash
| | | | Timestamp
| | | Label
| | Patch
| Minor
Major