Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/pull_request_template/release.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## 🎉 New Features
- Remove

## 🐛 Bug fixes
- Remove

## 🔧 Other changes
- Remove
## 🎉 New Features
- Remove
## 🐛 Bug fixes
- Remove
## 🔧 Other changes
- Remove
210 changes: 105 additions & 105 deletions .github/workflows/canary_release.yaml
Original file line number Diff line number Diff line change
@@ -1,106 +1,106 @@
name: Canary version Release

on:
pull_request:
types: [closed]
branches:
- develop

jobs:
release:
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest

permissions:
contents: write
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Get version and SHA
id: version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION_NUM=""
VERSION="${PACKAGE_VERSION}-canary-${SHORT_SHA}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT

- name: Create and push tag
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git tag -a "${{ steps.version.outputs.version }}" -m "Canary release ${{ steps.version.outputs.version }}"
git push origin "${{ steps.version.outputs.version }}"

- name: Prepare release contents
id: release_contents
run: |
cat << 'EOF' > pr_body.txt
# 🚀 New Canary Release (`${{ steps.version.outputs.version }}`)

EOF

cat << 'EOF' > pr_body.txt
${{ github.event.pull_request.body }}
EOF

cat << 'EOF' >> pr_body.txt

## 📦 Installation
```bash
npm install --dev @repixelcorp/hyper-pwt@${{ steps.version.outputs.version }}
```

## ⚠️ Warning
This is a canary release and should not be used in production environments.

EOF

echo "body<<EOF" >> $GITHUB_OUTPUT
cat pr_body.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: 🚀 ${{ steps.version.outputs.version }}
body: ${{ steps.release_contents.outputs.body }}
draft: false
prerelease: true

- name: Update package.json version
run: |
npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version

- name: Build package
run: pnpm build

- name: Publish to NPM
run: |
npm publish --tag canary --access public
env:
name: Canary version Release
on:
pull_request:
types: [closed]
branches:
- develop
jobs:
release:
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: Get version and SHA
id: version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION_NUM=""
VERSION="${PACKAGE_VERSION}-canary-${SHORT_SHA}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git tag -a "${{ steps.version.outputs.version }}" -m "Canary release ${{ steps.version.outputs.version }}"
git push origin "${{ steps.version.outputs.version }}"
- name: Prepare release contents
id: release_contents
run: |
cat << 'EOF' > pr_body.txt
# 🚀 New Canary Release (`${{ steps.version.outputs.version }}`)
EOF
cat << 'EOF' > pr_body.txt
${{ github.event.pull_request.body }}
EOF
cat << 'EOF' >> pr_body.txt
## 📦 Installation
```bash
npm install --dev @repixelcorp/hyper-pwt@${{ steps.version.outputs.version }}
```
## ⚠️ Warning
This is a canary release and should not be used in production environments.
EOF
echo "body<<EOF" >> $GITHUB_OUTPUT
cat pr_body.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.version }}
release_name: 🚀 ${{ steps.version.outputs.version }}
body: ${{ steps.release_contents.outputs.body }}
draft: false
prerelease: true
- name: Update package.json version
run: |
npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version
- name: Build package
run: pnpm build
- name: Publish to NPM
run: |
npm publish --tag canary --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading