Skip to content

improve error handling #7

improve error handling

improve error handling #7

Workflow file for this run

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
test-linux:
runs-on: ubuntu-latest
name: Build and Test
steps:
- uses: actions/checkout@v3
- uses: mlugg/setup-zig@v1
with:
version: 0.13.0
- name: Get release name
id: get_release_name
uses: actions/github-script@v7
with:
result-encoding: string
script: |
if (!context.ref.startsWith("refs/tags/")) {
console.log("ref", context.ref)
core.setFailed('could not locate the tag')
}
let matches = context.ref
.split("refs/tags/")[1]
.match(/^[0-9]+\.[0-9]+\.[0-9]+/g) ?? []
if (matches.length != 1) {
console.log("ref", context.ref)
core.setFailed('could not parse the tag')
}
return matches[0]
- run: zig run bindings/ci.zig -- publish --sha=${{ github.sha }} --tag=${{ steps.get_release_name.outputs.result }}
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}