Skip to content

Commit

Permalink
ci: cleanup release action naming (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth authored Oct 11, 2024
1 parent bde69ec commit e2c7319
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 65 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-avocados-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axelar-network/axelar-cgp-sui': patch
---

create an npm task for snapshot release and cleanup workflow names
42 changes: 42 additions & 0 deletions .github/workflows/create-release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow concerns the preparation of the `changeset` PR and keeping it updated by tracking the changes on `main` branch.
name: Create Release PR

on:
workflow_dispatch:

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

jobs:
create-release-pr:
name: Create Release PR
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Check for changeset files
run: |
if ! ls .changeset/*.md | grep -q '\.changeset\/[a-z-]\+\.md$'; then
echo "No changeset files found. Exiting workflow."
exit 1
fi
echo "Changeset files found. Continuing with the workflow."
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
install-nodejs: 'true'

# Keep the version of the PRs up-to-date
- name: Create Release Pull Request
id: release-pr
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
with:
branch: 'main'
title: 'chore(release): bump version and update changelog'
commit: 'chore(release): bump version and update changelog'
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
54 changes: 0 additions & 54 deletions .github/workflows/pre-release.yaml

This file was deleted.

11 changes: 2 additions & 9 deletions .github/workflows/release-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ jobs:
install-sui: 'true'
install-nodejs: 'true'

- 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
- name: Build and Publish a Snapshot to NPM
run: |
npm publish --no-git-checks --tag snapshot --access public
npm run release-snapshot
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:
with:
persist-credentials: false

- name: Setup the required tools (sui, nodejs)
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
install-sui: 'true'
install-nodejs: 'true'

# Publishes a release in case the release isn't published
- name: Publish release
uses: changesets/action@v1
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
with:
publish: npm run release
createGithubReleases: true
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"test": "npm run test-move && npm run test-js",
"coverage": "./scripts/coverage.sh",
"release": "npm run build && changeset publish",
"release-snapshot": "npm run build && npm version 0.0.0-snapshot.$(git rev-parse --short HEAD) --git-tag-version=false && npm publish --no-git-checks --tag snapshot --access public",
"cs": "changeset",
"lint": "eslint --fix './src/*.ts' './test/*.js'",
"prettier": "prettier --write './src/*.ts' './test/*.js'",
Expand Down

0 comments on commit e2c7319

Please sign in to comment.