1.3.1 #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
release: | |
types: [published] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_VERSION: 1.81.0 | |
jobs: | |
validate: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 # v4 | |
- uses: MeilCli/regex-match@v1 | |
name: SemVer Validation | |
id: regex-match | |
with: | |
search_string: ${{ github.event.release.tag_name }} | |
regex_pattern: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' | |
# SemVer Regex https://ihateregex.io/expr/semver/ | |
- name: SemVer check failed | |
if: ${{ steps.regex-match.outputs.matched == 'false' }} | |
run: exit 1 | |
publish: | |
runs-on: ubuntu-22.04 | |
needs: [validate] | |
steps: | |
- uses: actions/checkout@v4 # v4 | |
- name: Cache SDK | |
id: cache-sdk | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/sdk/ | |
key: cache-sdk | |
- name: Google Storage authentication | |
if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | |
export_environment_variables: true | |
create_credentials_file: true | |
- name: Set up Cloud SDK | |
if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Download dependencies | |
if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }} | |
run: make dl-sdk | |
- name: Install dependencies ubuntu | |
run: make install-deps | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
- uses: katyo/publish-crates@v2 | |
with: | |
dry-run: ${{ github.event_name != 'release' }} | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} |