Skip to content

Merge pull request #39 from omnisat/hath #39

Merge pull request #39 from omnisat/hath

Merge pull request #39 from omnisat/hath #39

Workflow file for this run

name: Release
on:
push:
branches:
- dev
- main
jobs:
detect-changes-and-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.6
- name: Install dependencies
run: pnpm install
- name: Check if lasereyes package changed
id: check_changes
run: |
git diff --quiet HEAD^ HEAD -- packages/lasereyes || echo "changed=true" >> $GITHUB_ENV
# Automatically add a changeset if changes are detected
- name: Add Changeset if lasereyes package changed
if: env.changed == 'true'
run: |
pnpm dlx changeset add --empty --force --commit \
--message "chore: auto-bump lasereyes version"
# Enter pre-release mode for RC if on dev
- name: Run Changesets pre-release mode for RC
if: github.ref == 'refs/heads/dev' && env.changed == 'true'
run: |
pnpm dlx @changesets/cli pre enter rc
pnpm dlx @changesets/cli version
# Commit version bump
- name: Commit version bumps and changelog
if: github.ref == 'refs/heads/dev' && env.changed == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "RC version bump for lasereyes"
git push origin dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-rc-release:
runs-on: ubuntu-latest
needs: detect-changes-and-version
if: github.ref == 'refs/heads/dev' && env.changed == 'true'

Check failure on line 63 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 63, Col: 9): Unrecognized named-value: 'env'. Located at position 35 within expression: github.ref == 'refs/heads/dev' && env.changed == 'true' .github/workflows/release.yml (Line: 83, Col: 9): Unrecognized named-value: 'env'. Located at position 36 within expression: github.ref == 'refs/heads/main' && env.changed == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: pnpm install
- name: Publish RC to npm
run: pnpm publish --tag rc --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
changeset-stable-version:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && env.changed == 'true'
needs: publish-rc-release
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.6
- name: Install dependencies
run: pnpm install
- name: Exit pre-release mode
run: pnpm dlx @changesets/cli pre exit
- name: Run Changesets version for stable
run: pnpm dlx @changesets/cli version
- name: Commit version bumps and changelog for stable
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Stable version bump for lasereyes"
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-stable-release:
runs-on: ubuntu-latest
needs: changeset-stable-version
if: github.ref == 'refs/heads/main' && env.changed == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: pnpm install
- name: Publish stable release to npm
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.sha }}
release_name: "Stable Release ${{ github.sha }}"
body_path: releases/main_summary_notes_$(date +'%Y-%m-%d').md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}