diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac429b871..b7b1cbf25 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,9 @@ name: Release on: workflow_dispatch: - inputs: - name: - description: 'Person to greet' - required: true - default: 'Mona the Octocat' - home: - description: 'location' - required: false - default: 'The Octoverse' jobs: release: + name: NPM Publish runs-on: ubuntu-latest steps: - run: echo "Hello ${{ github.event.inputs.name }} - in ${{ github.event.inputs.home }}!" @@ -23,13 +15,35 @@ jobs: registry-url: https://registry.npmjs.org - run: npm ci - run: npm pack - - run: echo "Release ${{ github.ref }}" - id: version run: echo "version=$(npm run version --silent)" >> $GITHUB_ENV - run: echo "Deploying version ${{ env.version }}" -# - run: npm publish --tag alpha -# env: -# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: npm publish --dry-run + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + postRelease: + name: Version Upgrade and tag + needs: release + runs-on: ubuntu-latest + steps: + - run: echo "Hello ${{ github.event.inputs.name }} - in ${{ github.event.inputs.home }}!" + - name: Checkout code + uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 12.x + registry-url: https://registry.npmjs.org + - run: npm ci + - id: version + run: echo "version=$(npm run version --silent)" >> $GITHUB_ENV + - run: git tag -fa "v${{ env.version }}" -m "Releasing version ${{ env.version }}" + - run: npm version patch -m "Increasing version to %s" --git-tag-version false + - id: newVersion + run: echo "newVersion=$(npm run version --silent)" >> $GITHUB_ENV + - run: git add . + - run: git commit -m "Creating new version ${{ env.newVersion }}" +# - run: git push --set-upstream origin main:main +# - run: git push --tags origin # - name: Create Release # id: create_release # uses: actions/create-release@v1 diff --git a/.gitmodules b/.gitmodules index dcf374d36..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "travis"] - path = travis - url = https://github.com/nemgrouplimited/travis-functions.git diff --git a/.travis-back.yml b/.travis-back.yml deleted file mode 100644 index 5e433fc97..000000000 --- a/.travis-back.yml +++ /dev/null @@ -1,53 +0,0 @@ -dist: bionic -language: node_js -node_js: - - 12 - - lts/* - - node -services: - - docker -env: - global: - - DOCKER_COMPOSE_VERSION=1.25.0 - - DEV_BRANCH=dev - - RELEASE_BRANCH=main - - POST_RELEASE_BRANCH=main - - RELEASE_MESSAGE=release -cache: - bundler: true - directories: - - node_modules - - .eslintcache -before_script: - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin - - . ./travis/node-functions.sh - - VERSION="$(node_load_version)" - - if [[ ! -z "$DOCKER_USERNAME" ]] ; then echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin; fi - - log_env_variables -script: - - npm pack - - npm test - - npm run coveralls-report -jobs: - include: - - stage: test - name: docs - script: npm run doc - - stage: publish - name: github alpha pages - script: /bin/bash travis/node-functions.sh node_push_github_pages - if: branch = env(DEV_BRANCH) AND type = push - - name: alpha npm - script: npm pack && /bin/bash travis/node-functions.sh node_publish_alpha - if: (branch = env(DEV_BRANCH) AND type = push) OR (type = api AND commit_message = alpha) - - stage: release - name: release npm - script: npm pack && /bin/bash travis/node-functions.sh node_publish_release - if: branch = env(RELEASE_BRANCH) AND type = api AND commit_message = env(RELEASE_MESSAGE) - - stage: post release - name: tag and version upgrade - script: npm pack && /bin/bash travis/node-functions.sh node_post_release - if: branch = env(RELEASE_BRANCH) AND type = api AND commit_message = env(RELEASE_MESSAGE) diff --git a/alpha.sh b/alpha.sh index a9a2b0c49..f26d530a9 100644 --- a/alpha.sh +++ b/alpha.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash set -e -. ./travis/node-functions.sh -VERSION="$(node_load_version)" +VERSION="$(npm run version --silent)" TAG=${1:-alpha} echo "publishing $VERSION with tag $TAG" npm pack -/bin/bash travis/node-functions.sh node_publish_alpha $TAG +NEW_VERSION="$VERSION-$TAG-$(date +%Y%m%d%H%M)" +npm version "$NEW_VERSION" --commit-hooks false --git-tag-version false +npm publish --tag alpha npm version "$VERSION" --commit-hooks false --git-tag-version false npm run style:fix diff --git a/travis b/travis deleted file mode 160000 index 0bb6dbe23..000000000 --- a/travis +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0bb6dbe2323a54e25892fafaa465b0e30e25f802