Skip to content

fixing bug in hook

fixing bug in hook #26

name: Build & Publish Extension
on:
push:
branches: ["main", "devel"]
jobs:
build-retool-embedder:
name: "Build, Bundle, Release"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short git commit SHA
id: vars
run: |
shortSha=$(git rev-parse --short ${{ github.sha }})
branch=$(git rev-parse --abbrev-ref HEAD)
zipfile=$(cat package.json | jq -r '"\(.name)-\(.version)"')
echo "COMMIT_SHORT_SHA=$shortSha" >> $GITHUB_ENV
echo "COMMIT_BRANCH=$branch" >> $GITHUB_ENV
echo "ZIP_FILE=$zipfile" >> $GITHUB_ENV
- name: Confirm env.COMMIT_SHORT_SHA
run: "echo 'env.COMMIT_SHORT_SHA === ${{ env.COMMIT_SHORT_SHA }}'"
- name: Confirm env.COMMIT_BRANCH
run: "echo 'env.COMMIT_BRANCH === ${{ env.COMMIT_BRANCH }}'"
- name: Confirm env.ZIP_FILE
run: "echo 'env.ZIP_FILE === ${{ env.ZIP_FILE }}'"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: Build Extension
run: |-
npm ci
npm run build
- name: Archive retool-embedder Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ZIP_FILE }}
path: ${{ env.ZIP_FILE }}.zip
- name: Create and publish release
uses: ncipollo/release-action@v1
with:
tag: "ci-${{ env.COMMIT_BRANCH }}-${{ env.COMMIT_SHORT_SHA }}"
commit: ${{ env.COMMIT_BRANCH }}
artifacts: "${{ env.ZIP_FILE }}.zip"
body: "# Retool Embedder - CI Build\n## ${{ env.ZIP_FILE }}.zip"