- Action 'badges/coverlet-coverage-badge'
- Action 'badges/shields-io-badge'
- Action 'devhub/uno-platform/read-manifest'
- Action 'devhub/uno-platform/setup'
- Action 'package/appimage/pack'
- Action 'package/appimage/setup-appimagetool'
- Action 'package/nuget/pack'
- Action 'toolset/file/read'
- Action 'toolset/file/replace-text'
- Action 'toolset/assign-version'
- Action 'toolset/github/upload-release-asset'
- Action 'toolset/select-configuration'
This creates test coverage badges from the coverlet.collector
test report. Example badge:
- Test project:
- Add nuget coverlet.collector.
- Github Gist:
- Create secret gist;
- Copy
gist-id
to new repository or organization variables (e.g., variable nameGIST_ID
).
- Personal access tokens:
- Generate new token;
- Add
Gists
permission; - Copy token value to new repository or organization secret (e.g., secret name
TOKEN_GITHUB_GIST
).
- Action
badges/coverlet-coverage-badge
can be added to the Github workflow:
- shell: bash
run: |
dotnet test ./source/test.csproj --collect:"XPlat Code Coverage" --results-directory="./source/TestResults"
- id: coverlet-coverage-badge
uses: finebits/github-actions/badges/coverlet-coverage-badge@v3
with:
report-root: ./source/TestResults/**/
report-filename: coverage.cobertura.xml
gist-filename-format: "${{ github.event.repository.name }}-{0}-test-coverage.json"
gist-id: ${{ vars.GIST_ID }}
gist-auth-token: ${{ secrets.TOKEN_GITHUB_GIST }}
- shell: bash
run: |
json='${{ steps.coverlet-coverage-badge.outputs.badges-links }}'
len=$(echo $json | jq '. | length')
for ((i=0; i<$len; i++)); do
echo -e "Badge link #"$i" $(echo $json | jq -r '.['$i']')\n"
done
label
- The badge label, default: "Test coverage"package-label-format
- The label format of the package badges, default: "{0}: test coverage"label-color
- Background color of the left part (hex, rgb, rgba, hsl, hsla and css named colors supported), default: greylogo
- One of the named logos supported by Shieldslogo-svg
- An SVG string containing a custom logologo-color
- Supported for named logos and Shields logosstyle
- The default template to use, default: flatgist-filename-format
- The format name for the 'Github Gist' file that stores the badge's metadata, default: "{0}-test-coverage.json"report-root
- (required) Report root directoryreport-filename
- Report filename, default: "coverage.cobertura.xml"gist-id
- (required) The unique identifier of the 'Github Gist' where badge metadata is storedgist-auth-token
- (required) Authentication token to update the the 'Github Gistgist-owner
- 'Github Gist' owner, default: ${{ github.repository_owner }}
badges-links
- contains a json array of markdown badges links
This generates Shields.io endpoint badge. Example badge:
- Github Gist:
- Create secret gist;
- Copy
gist-id
to new repository or organization variables (e.g., variable nameGIST_ID
).
- Personal access tokens:
- Generate new token;
- Add
Gists
permission; - Copy token value to new repository or organization secret (e.g., secret name
TOKEN_GITHUB_GIST
).
- Action
badges/shields-io-badge
can be added to the Github workflow:
- id: shields-io-badge
uses: finebits/github-actions/badges/shields-io-badge@v3
with:
label: shields.io
label-color: lightblue
message: badge
message-color: gold
logo: github
logo-color: blue
style: flat
gist-filename: "shields-io-badge.json"
gist-id: ${{ vars.GIST_ID }}
gist-auth-token: ${{ secrets.TOKEN_GITHUB_GIST }}
- shell: bash
run: |
echo "Badge: ${{ steps.shields-io-badge.outputs.badge-link }}"
label
- (required) The left side text of the badge, it might be emptymessage
- (required) The right side text, it can't be emptylabel-color
- Background color of the left part (hex, rgb, rgba, hsl, hsla and css named colors supported), default: greymessage-color
- Background color of the right part (hex, rgb, rgba, hsl, hsla and css named colors supported), default: lightgreyis-error
- True to treat this as an error badge, default: falselogo
- One of the named logos supported by Shieldslogo-svg
- An SVG string containing a custom logologo-color
- Supported for named logos and Shields logoslogo-width
- Logo widthlogo-position
- Logo positionstyle
- The default template to use, default: flatbadge-description
- gist file descriptiongist-filename
- (required) The format name for the 'Github Gist' file that stores the badge's metadatagist-id
- (required) The unique identifier of the 'Github Gist' where badge metadata is storedgist-auth-token
- (required) Authentication token to update the the 'Github Gist'gist-owner
- 'Github Gist' owner, default: ${{ github.repository_owner }}
badge-link
- markdown badge link
Read the Uno Platform setup manifest from the uno-check
tool.
Important
Prerequisites: .NET SDK (i.e., uses: actions/setup-dotnet)
- id: uno-check-manifest
uses: finebits/github-actions/devhub/uno-platform/read-manifest@v3
- shell: bash
run: |
dotnet_version="${{ fromJSON(steps.uno-check-manifest.outputs.content).check.variables.DOTNET_SDK_VERSION }}"
uno-check-manifest
- Specific manifest URL of the uno-check tooluno-check-version
- Specific version of the uno-check tool
content
- Contents of the Uno Platform manifest file
Sets up the Uno Platform and its dependencies.
- uses: finebits/github-actions/devhub/uno-platform/setup@v3
uno-sdk-version
- Specifies the version of the Uno.Sdkuno-check-skip
- Skips a checkup by name or ID as listed in uno-check list, default: xcode vswin vsmac windowshyperv edgewebview2 androidemulator dotnetnewunotemplatesuno-check-manifest
- Specifies the manifest URL of the 'uno-check' tooluno-check-version
- Specifies the version of the 'uno-check' tooldefault-dotnet-version
- Specifies the version of dotnet to install by default, default: 8.xdotnet-install-dir
- Specifies the location of the dotnet. This allows you to ignore the pre-installed dotnet, default: ${{ github.workspace }}/.dotnet
Action has no outputs.
This packages a desktop application as an AppImage that runs on common Linux-based operating systems such as RHEL, CentOS, Ubuntu, Fedora, Debian and etc.
Important
This action can only be used on Linux (i.e., runs-on: ubuntu-latest).
jobs:
appimage:
runs-on: ubuntu-latest
Action package/appimage/pack
can be used in the Github workflow:
- uses: finebits/github-actions/package/appimage/pack@v3
with:
package-runtime: x86_64
package-app-dir: ./.publish/appimage-package/AppDir
package-output-dir: ./publish/output/packages
package-app-dir
- (required) Path to Package AppDir directorypackage-runtime
- The package runtime. It can take one of the values: [aarch64, armhf, i686, x86_64], default: x86_64package-output-dir
- Path to output directory, default: ./.output/
package
- Path to file *.AppImage
This setups appimagetool, its runtimes and static tools.
Important
This action can only be used on Linux (i.e., runs-on: ubuntu-latest).
jobs:
appimage:
runs-on: ubuntu-latest
Action package/appimage/setup-appimagetool
can be used in the Github workflow:
- uses: finebits/github-actions/package/appimage/setup-appimagetool@v3
Action has no inputs.
Action has no outputs.
This packages the project into a NuGet package. Also pack-nuget action can:
- sign the NuGet package
- push to nuget.org and/or nuget.pkg.github.com
- save the NuGet artifact to Github
- uses: finebits/github-actions/package/nuget/pack@v3
with:
project: ./source/Hello.Nuget.csproj
configuration: Release
upload-artifact: true
artifact-name: Hello.Nuget
push-to-nuget: true
nuget-apikey: ${{ secrets.NUGET_APIKEY }}
push-to-github: true
github-token: ${{ secrets.TOKEN_GITHUB_PACKAGE }}
github-owner: ${{ github.repository_owner }}
certificate: ${{ secrets.NUGET_BASE64_CERT }}
certificate-password: ${{ secrets.NUGET_CERT_PASSWORD }}
project
- (required) Project file for NuGet packagingconfiguration
- (required) Defines the build configurationupload-artifact
- The true value allows you to save the NuGet artifact, default: falseartifact-name
- Defines the artifact file name, default: nugetpush-to-nuget
- The true value allows you to push the nuget to nuget.org, default: falsenuget-apikey
- The API key for nuget.orgpush-to-github
- The true value allows you to push the nuget to nuget.pkg.github.com, default: falsegithub-token
- Github token (required write:packages scopes)github-owner
- Github package ownercertificate
- Base64 encoded certificatecertificate-password
- A password stringfile-version
- Redefines assembly version, default version calculated from git tagpackage-version
- Redefines the NuGet package version, default version calculated from git tag
artifact-full-name
- final nuget artifact name
This reads the contents of a file and saves it in the output.
Action toolset/file/read
can read file in the Github workflow:
- id: read-config
uses: finebits/github-actions/toolset/file/read@v3
with:
url: http://site.com/config.json
file: config.json
- shell: bash
run: |
option="${{ fromJSON(steps.read-config.outputs.content).option }}"
where config.json:
{
"option":"value"
}
url
- Link to file.file
- Path to local file. This is used if the inputurl
is empty or the http status is not OK(200).
content
- file contents
This replaces all occurrences of a placeholder with a given value string inside a file.
- uses: finebits/github-actions/toolset/file/replace-text@v3
with:
file: ./source/hello.js
find-what: <!placeholder>
replace-with: "hello world"
file
- (required) Path to source filefind-what
- (required) Replacement textreplace-with
- (required) Required text
Action has no outputs.
This gets a version number using a git tag, a git commit, a Github workflow context.
- id: version
uses: finebits/github-actions/toolset/assign-version@v3
- shell: bash
run: |
echo "Current version: ${{ steps.version.outputs.preset-semantic-v1 }}"
Action has no inputs.
run-number
- contains the run number of the workflow (look at github action context)run-attempt
- contains the re-run number of the workflow (look at github action context)today
- contains the date of the workflow execution in the formatyyyymmdd
today-compact
- contains the date of the workflow execution in the formatyymmdd
commit-hash
- contains the full SHA-1 hash of the latest commit in the current branchcommit-short-hash
- contains the short SHA-1 hash of the latest commit in the current branchtotal-commits
- contains the number of commits for the current branch
If there is tag in the format v{major}[.{minor}[.{patch}]][-{suffix}]
(e.g., v1.2-beta) then
major
- contains the value of the major component of the version number, default value 1minor
- contains the value of the minor component of the version number, default value 0patch
- contains the value of the patch component of the version number, default value 0suffix
- contains the suffix version, it can be empty
Preset version formats:
preset-numeric
- version format:{major}.{minor}.{patch}
preset-semantic-v1
- version format:{major}.{minor}.{patch}[-{suffix}]
preset-semantic-v2
- version format:{major}.{minor}.{patch}[-{suffix}]+{commit-hash}
preset-semantic-v2-extended
- version format:{major}.{minor}.{patch}[-{suffix}]+{today}.{run-number}.{run-attempt}.{commit-hash}
It uploads an asset to the existing release. Also upload-release-asset action can upload several assets if the path contains a pattern.
- uses: finebits/github-actions/toolset/github/upload-release-asset@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
path: "assets/*"
github-token
- (required) The github token must have contents:write permissionpath
- (required) Path to asset file. This can be a pattern-path to several filestag
- The name of the tag. To use the latest release, leave the value unset. default: unsetgithub-api-version
- To specify a version of the Github REST API, default: 2022-11-28github-repository
- The name of the repository (e.g., finebits/github-actions). The name is not case sensitive. default: ${GITHUB_REPOSITORY}
Action has no outputs.
This allows you to select configurations from JSON by keywords.
The config.json file contains several configurations:
[
{
"keywords":["A","B"],
"option":"value-a"
},
{
"keywords":["A","C"],
"option":"value-b"
},
{
"keywords":["C","B"],
"option":"value-c"
}
]
Action toolset/select-configuration
can select a configuration in the Github workflow:
- id: config
uses: finebits/github-actions/toolset/select-configuration@v3
with:
json-file: config.json
keywords: A B
- shell: bash
run: |
option="${{ fromJson(steps.config.outputs.config-json)[0].option }}"
Action toolset/select-configuration
can be used as a source of strategy:
jobs:
prepare:
runs-on: 'ubuntu-latest'
outputs:
matrix: ${{ steps.config.outputs.matrix }}
steps:
- id: config
uses: finebits/github-actions/toolset/select-configuration@v3
with:
json-file: config.json
keywords: A
process:
needs: prepare
strategy:
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
json
- JSON data. This should only be empty if the inputjson-file
has path to JSON-filejson-file
- Path to JSON file. This is ignored if the inputjson
is not emptykeywords
- (required) A set of keywords separated by the SPACE symbolconfigs-set-jsonpath
- JSON path to the configuration set, where "." is the JSON root, default: '.'keywords-set-jsonpath
- JSON path to a set of keys, where "." is the configuration root, default: '.keywords'exclude-keywords
- It excludes keywords from the output JSON configurations, default: true
config-json
- output configuration array in JSON formatmatrix
- configurations prepared as a source of strategylength
- contains the number of suitable configurationsis-empty
- true if no matching configuration exists