Skip to content

Commit

Permalink
chore: add release snapshot workflow (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
npty authored Jul 23, 2024
1 parent ab7235b commit 72579e5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release Snapshot

on:
workflow_dispatch:

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
SUI_VERSION: mainnet-v1.25.3

jobs:
release-snapshot:
name: Release Snapshot
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Sui CLI and install dependencies
uses: ./.github/actions/install
with:
SUI_VERSION: ${{ env.SUI_VERSION }}

- name: Build TS and SUI modules
run: npm run build

- name: Set Snapshot Version
run: |
npm version 0.0.0-snapshot.$(git rev-parse --short HEAD) --git-tag-version=false
- name: Publish Snapshot to NPM
run: |
npm publish --no-git-checks --tag snapshot --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21 changes: 13 additions & 8 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# How to Release a New Version

## Release Official Versions

To release a new version, follow these steps after creating a PR with your changes:

## 1. Update the Changeset File
### 1. Update the Changeset File

In your branch, run the following command to create a new changeset file:

Expand All @@ -18,20 +20,23 @@ You will be prompted to specify the type of changes you are making. Choose from

Next, you will be prompted to enter a summary of the changes you made. This will be used to generate the release notes in the `CHANGELOG.md` file.

## 2. Commit the Changeset File
### 2. Commit the Changeset File

```bash
git add .
git commit -m "chore: update changeset"
git push
```

## 3. Merge the PR
### 3. Trigger the Release Workflow

Trigger the release workflow [here](https://github.com/axelarnetwork/axelar-cgp-sui/actions/workflows/release.yaml) when you want to publish the package. The release PR will be created. This PR will:

Once the PR is merged into the main branch, a release PR will be automatically created. This PR will:
- Update the `CHANGELOG.md` file with the changes made in the release.
- Bump the version number of the package.
- Publish the package to NPM.
- Create a new GitHub release.

## Release Snapshot Versions

- Update the `CHANGELOG.md` file with the changes made in the release.
- Bump the version number of the package.
- Publish the package to NPM.
- Create a new GitHub release.
If you need to release a snapshot version for development or testing purposes, you can do so by triggering the snapshot release workflow [here](https://github.com/axelarnetwork/axelar-cgp-sui/actions/workflows/release-snapshot.yaml)

0 comments on commit 72579e5

Please sign in to comment.