GitHub Action to validate a product version string
MPL-2.0 License
Given an expected version string,
check that the tool emits a matching version string.
The artifact path may refer to a single artifact
or a directory of artifacts to test.
Executables must support a version
subcommand
and are executed as $executable version
.
Currently supported artifact types:
foo.zip
-- required to contain executable foo
, which will be extracted and executed for the testfoo
-- executable to be run as-isSupported builds are enumerated in supported_builds.json (separated by license class for simpler maintenance of the file).
jobs:
test-version-string:
name: "Test Version String"
runs-on: ubuntu-latest
# needs: [ ... ]
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# this example uses set-product-version like many CRT build workflows
- uses: hashicorp/actions-set-product-version@v1
name: Set Product Version
id: set-product-version
# ... potentially other steps ...
- name: Test
uses: hashicorp/actions-validate-product-version@v1
with:
expected_version: ${{ needs.set-product-version.outputs.product-version }}
artifact_path: ./consul
Input | Description |
---|---|
expected_version |
The version the artifact expected to declare |
artifact_path |
The path to the artifact to test (may be a directory) |
soft_fail |
If non-empty, unsupported product error is non-fatal |
act --container-architecture=linux/amd64 --workflows .github/workflows/test.yml
main
.main
branch and pull the latest changes.v1.0.1
with git tag v1.0.1 && git push origin v1.0.1
.git tag -d v1 && git tag v1
git push origin :refs/tags/v1 && git push origin v1