Skip to content

fix: do not send package via outdated session (#1559) #9

fix: do not send package via outdated session (#1559)

fix: do not send package via outdated session (#1559) #9

name: Continuous Deployment
on:
push:
branches:
- main
env:
NODE_OPTIONS: --max_old_space_size=6144
jobs:
release-canary:
runs-on: aries-ubuntu-2004
name: Release Canary
if: "!startsWith(github.event.head_commit.message, 'chore(release): v')"
steps:
- name: Checkout aries-framework-javascript
uses: actions/checkout@v3
with:
# pulls all commits (needed for lerna to correctly version)
fetch-depth: 0
# setup dependencies
- name: Setup Libindy
uses: ./.github/actions/setup-libindy
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'
- name: Install dependencies
run: yarn install --frozen-lockfile
# On push to main, release unstable version
- name: Release Unstable
run: |
export NEXT_VERSION_BUMP=$(./node_modules/.bin/ts-node ./scripts/get-next-bump.ts)
yarn lerna publish --loglevel=verbose --canary $NEXT_VERSION_BUMP --exact --force-publish --yes --no-verify-access --dist-tag alpha
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get version number
id: get-version
run: |
LAST_RELEASED_VERSION=$(npm view @aries-framework/core@alpha version)
echo version="${LAST_RELEASED_VERSION}" >> "$GITHUB_OUTPUT"
- name: Setup git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Set git tag
run: |
git tag v${{ steps.get-version.outputs.version }}
git push origin v${{ steps.get-version.outputs.version }} --no-verify
release-stable:
runs-on: aries-ubuntu-2004
name: Create Stable Release
# Only run if the last pushed commit is a release commit
if: "startsWith(github.event.head_commit.message, 'chore(release): v')"
steps:
- name: Checkout aries-framework-javascript
uses: actions/checkout@v3
# setup dependencies
- name: Setup Libindy
uses: ./.github/actions/setup-libindy
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
registry-url: 'https://registry.npmjs.org/'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Get updated version
id: new-version
run: |
NEW_VERSION=$(node -p "require('./lerna.json').version")
echo $NEW_VERSION
echo version="${NEW_VERSION}" >> "$GITHUB_OUTPUT"
- name: Create Tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.new-version.outputs.version }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.new-version.outputs.version }}
body: |
Release v${{ steps.new-version.outputs.version }}
You can find the changelog in the [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) file.
- name: Release to NPM
run: yarn lerna publish from-package --loglevel=verbose --yes --no-verify-access
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}