Skip to content

Commit

Permalink
Merge branch 'main' into monter82/mc-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
montera82 committed Sep 6, 2023
2 parents 6c61dc5 + 1d827b0 commit f4f7946
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 67 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,6 @@ jobs:
- run: yarn build
- run: yarn lint
- run: yarn test
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty after building"
exit 1
fi
# - name: Validate RC changelog
# if: ${{ startsWith(github.head_ref, 'release/') }}
# run: yarn auto-changelog validate --rc
# - name: Validate changelog
# if: ${{ !startsWith(github.head_ref, 'release/') }}
# run: yarn auto-changelog validate
all-jobs-pass:
name: All jobs pass
runs-on: ubuntu-20.04
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/check-package-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Check Package Version in PR

on:
pull_request:
branches:
- main
paths:
- 'packages/snap/src/**'

jobs:
check_version:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 'create-main-branch'
run: 'git branch --track main origin/main'

- name: Get version from main branch
id: get_version_main
run: echo "::set-output name=version::$(git show HEAD~1:package.json | grep '"version":' | cut -d '"' -f 4)"

- name: Get version from PR branch
id: get_version_pr
run: echo "::set-output name=version::$(grep '"version":' package.json | cut -d '"' -f 4)"

- name: Compare versions and prevent merging if the same
run: |
if [ "${{ steps.get_version_main.outputs.version }}" == "${{ steps.get_version_pr.outputs.version }}" ]; then
echo "Error: Versions in main branch and PR are the same - please upgrade version in PR."
exit 1
else
echo "Versions are different, allowing merge"
echo "::set-output name=version_changed::true"
fi
18 changes: 18 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'NPM Publish'
on:
release:
types: [published]

jobs:
NPM-Publish:
permissions:
contents: read
id-token: write

uses: celo-org/reusable-workflows/.github/workflows/[email protected]
with:
node-version: 16
package-dir: 'packages/snap'
akeyless-api-gateway: https://api.gateway.akeyless.celo-networks-dev.org
akeyless-github-access-id: p-kf9vjzruht6l
akeyless-token-path: /static-secrets/apps-tooling-circle/npm-publish-token
48 changes: 0 additions & 48 deletions .github/workflows/publish-release.yml

This file was deleted.

14 changes: 8 additions & 6 deletions packages/snap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,17 @@ This example shows how one can use the snap to send a more generic transaction.

## Publishing a new version of the Snap.

In other to update the snap to publish a new change, Update the `version` tag in both `packages/snap/snap.config.js` and `packages/snap/package.json` to the same. Then from you console run the following commands.
In other to update the snap to publish a new change, Update the `version` tag in both `packages/snap/snap.config.js` and `packages/snap/package.json` to the same.

Note: You must be logged into NPM on your terminal as well as added to the celo organization on npm.
Next create a new Release:
You can do this by going to the "Releases" tab, then clicking the "Create a new release" button.

```
cd packages/snap
Tag version: Specify the version number, such as v1.0.0 ( keep this consistent with those above )
Release title: Provide a descriptive title for the release.
Describe the release: Add any release notes, changelog information, or details about what's included in this release.
Choose "Publish release" to create the release.

npm publish --access public
```
Action should automatically trigger the job.

## Register a new coin type.

Expand Down

0 comments on commit f4f7946

Please sign in to comment.