From 9588af4f8fb17d1cf5c66c076213aa64a27593f0 Mon Sep 17 00:00:00 2001 From: Tudor Morar Date: Wed, 1 May 2024 12:34:41 +0300 Subject: [PATCH] Added github actions --- .github/pull_request_template.md | 22 +++++++++++++ .github/workflows/changelog.yml | 16 ++++++++++ .github/workflows/npm-publish.yml | 52 +++++++++++++++++++++++++++++++ CHANGELOG.md | 11 +++++++ 4 files changed, 101 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/changelog.yml create mode 100644 .github/workflows/npm-publish.yml create mode 100644 CHANGELOG.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..16d659d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,22 @@ +### Issue/Feature + +### Reproduce +Issue exists on version `2.` of sdk-dapp. + +### Root cause + +### Fix + +### Additional changes + +### Contains breaking changes +[x] No + +[] Yes + +### Updated CHANGELOG +[x] Yes + +### Testing +[x] User testing +[] Unit tests diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..1b1502a --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,16 @@ +name: "CHANGELOG entry secretary" +on: + pull_request: + branches: [main, development] + # The specific activity types are listed here to include "labeled" and "unlabeled" + # (which are not included by default for the "pull_request" trigger). + # This is needed to allow skipping enforcement of the changelog in PRs with specific labels, + # as defined in the (optional) "skipLabels" property. + types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] + +jobs: + # Enforces the update of a changelog file on every pull request + changelog: + runs-on: ubuntu-latest + steps: + - uses: dangoslen/changelog-enforcer@v3 \ No newline at end of file diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..c697ee0 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,52 @@ +name: Publish sdk-dapp + +on: + push: + branches: [main] + repository_dispatch: + types: publish-npm + workflow_dispatch: + +permissions: + contents: write + +jobs: + publish-npm: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v1 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ + + - name: Setup yarn + run: npm install -g yarn + + - name: Install dependencies + run: yarn install + + - name: Run tests + run: yarn test + + - name: Build project + run: yarn build + + - name: Get package info + id: package + uses: andreigiura/action-nodejs-package-info@v1.0.2 + + - name: Publish to npmjs next version + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.package.outputs.is-prerelease == 'true'}} + run: echo ${{ steps.package.outputs.is-prerelease}} && cd dist && npm publish --tag next + + - name: Publish to npmjs + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + if: ${{ steps.package.outputs.is-prerelease == 'false' }} + run: cd dist && npm publish diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..30f772b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +- [Added network](https://github.com/multiversx/mx-sdk-dapp-core/pull/1) + +## [[v0.0.0]](https://github.com/multiversx/mx-sdk-dapp-core)] - 2024-04-17