Skip to content

Commit

Permalink
chore(release): v0.2.1-alpha.13
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Oct 2, 2024
1 parent 125a822 commit c260344
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
28 changes: 8 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,13 @@ jobs:
name: Release
runs-on: ubuntu-22.04

# Fetching tags: https://stackoverflow.com/a/76181083
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
fetch-tags: true

# Step output: https://stackoverflow.com/a/65616499
# Reading latest tag: https://stackoverflow.com/a/33733020
- name: Read git tag
id: git-tag
run: echo "TAG_NAME=$(git tag --points-at HEAD)" >> $GITHUB_OUTPUT

- name: Verify git tag
env:
GIT_TAG: ${{ steps.git-tag.outputs.TAG_NAME }}
if: startsWith(env.GIT_TAG, 'v') == false
run: echo "Missing or invalid git tag; aborting" && exit 1
- name: Read package version
id: version
run: echo "PKG_VERSION=v$(npm pkg get version | xargs)" >> $GITHUB_OUTPUT

- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
Expand All @@ -42,14 +30,14 @@ jobs:
with:
result-encoding: string
script: |
const gitTag = '${{ steps.git-tag.outputs.TAG_NAME }}'
console.log(`git tag: ${gitTag}`)
if (gitTag.match(/^v\d+\.\d+\.\d+$/)) {
const version = '${{ steps.version.outputs.PKG_VERSION }}'
console.log(`version: ${version}`)
if (version.match(/^v\d+\.\d+\.\d+$/)) {
distTag = 'latest'
} else if (gitTag.match(/^v\d+\.\d+\.\d+/)) {
} else if (version.match(/^v\d+\.\d+\.\d+/)) {
distTag = 'alpha'
} else {
core.setFailed('Tag must follow SemVer convention. Aborting.');
core.setFailed('Version must follow SemVer convention. Aborting.');
}
console.log(`npm dist tag: ${distTag}`)
return distTag
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "github:CartoDB/carto-api-client",
"author": "Don McCurdy <donmccurdy@carto.com>",
"packageManager": "yarn@4.3.1",
"version": "0.2.1-alpha.12",
"version": "0.2.1-alpha.13",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down

0 comments on commit c260344

Please sign in to comment.