Skip to content

fix: check handshake protocols array is not empty (#1948) #36

fix: check handshake protocols array is not empty (#1948)

fix: check handshake protocols array is not empty (#1948) #36

Workflow file for this run

name: Release
on:
push:
branches:
- main
- '**-pre'
permissions:
pull-requests: write
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9.1.0
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
title: 'chore(release): new version'
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}
- name: Get current package version
id: get_version
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")" >> $GITHUB_ENV
- name: Create Github Release
if: steps.changesets.outputs.published == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}
release-unstable:
name: Release Unstable
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'chore(release): version')"
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9.1.0
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Creating .npmrc
run: |
cat << EOF > ".npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}
- name: Create unstable release
run: |
# this ensures there's always a patch release created
cat << 'EOF' > .changeset/snapshot-template-changeset.md
---
'@credo-ts/core': patch
---
snapshot release
EOF
pnpm changeset version --snapshot alpha
pnpm build
pnpm changeset publish --tag alpha
CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag v$CURRENT_PACKAGE_VERSION
git push origin v$CURRENT_PACKAGE_VERSION --no-verify
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}