From 2ab12403a6c3e1411d8935989aca2cb3a8788be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Thu, 3 Sep 2020 10:40:24 +0200 Subject: [PATCH 1/2] add publish workflow --- .github/workflows/npm-publish.yml | 28 -------- .github/workflows/publish.yml | 102 ++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/npm-publish.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml deleted file mode 100644 index 05da276..0000000 --- a/.github/workflows/npm-publish.yml +++ /dev/null @@ -1,28 +0,0 @@ -# TODO: replace with something that uses beta tags depending on version -#name: npm-publish -#on: -# push: -# branches: -# - master # Change this to your default branch -#jobs: -# npm-publish: -# name: npm-publish -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@master -# - name: Set up Node.js -# uses: actions/setup-node@master -# with: -# node-version: 12.4.0 -# - name: Build library -# run: yarn install --frozen-lockfile && yarn run build -# - name: Publish if version has been updated -# uses: pascalgn/npm-publish-action@51fdb4531e99aac1873764ef7271af448dc42ab4 -# with: # All of theses inputs are optional -# tag_name: "v%s" -# tag_message: "v%s" -# commit_pattern: "^Release (\\S+)" -# env: # More info about the environment variables in the README -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated -# NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..018efd0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,102 @@ +# TODO: replace with something that uses beta tags depending on version +#name: npm-publish +#on: +# push: +# branches: +# - master # Change this to your default branch +#jobs: +# npm-publish: +# name: npm-publish +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@master +# - name: Set up Node.js +# uses: actions/setup-node@master +# with: +# node-version: 12.4.0 +# - name: Build library +# run: yarn install --frozen-lockfile && yarn run build +# - name: Publish if version has been updated +# uses: pascalgn/npm-publish-action@51fdb4531e99aac1873764ef7271af448dc42ab4 +# with: # All of theses inputs are optional +# tag_name: "v%s" +# tag_message: "v%s" +# commit_pattern: "^Release (\\S+)" +# env: # More info about the environment variables in the README +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated +# NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings +name: Release + +on: + push: + branches: + - 'master' + +jobs: + tag: + name: Check and Tag + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create tag + id: tag + uses: butlerlogic/action-autotag@1.1.1 + with: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + strategy: package # Optional, since "package" is the default strategy + tag_prefix: "v" + outputs: + tag: ${{ steps.tag.outputs.tagname }} + version: ${{ steps.tag.outputs.version }} + + publish: + name: Publish + runs-on: ubuntu-latest + needs: tag + if: ${{ needs.tag.outputs.tag != ''}} + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Nodejs + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - name: Install dependencies + run: yarn install --frozen-lockfile --non-interactive + + - name: Build packages + run: yarn run build + + - name: Publish packages + # manual switch to latest + run: yarn publish --ignore-scripts --no-git-tag-version --no-commit-hooks --non-interactive --tag beta + + - name: Get Changelog Entry + id: changelog_reader + uses: mindsers/changelog-reader-action@v2 + with: + version: ${{ needs.tag.outputs.version }} + path: ./CHANGELOG.md + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ needs.tag.outputs.tag }} + body: ${{ steps.changelog_reader.outputs.changes }} + prerelease: true + release_name: Release ${{ needs.tag.outputs.tag }} + #in case of failure + - name: Rollback on failure + if: failure() + uses: author/action-rollback@9ec72a6af74774e00343c6de3e946b0901c23013 + with: + id: ${{ steps.create_release.outputs.id }} + tag: ${{ needs.tag.outputs.tag }} + delete_orphan_tag: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c2784b1d379bbcddb6dcf01c9510ea490137723c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Thu, 3 Sep 2020 10:40:43 +0200 Subject: [PATCH 2/2] Release 2.0.1 --- .github/workflows/publish.yml | 28 ---------------------------- CHANGELOG.md | 2 +- package.json | 2 +- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 018efd0..e0f6094 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,31 +1,3 @@ -# TODO: replace with something that uses beta tags depending on version -#name: npm-publish -#on: -# push: -# branches: -# - master # Change this to your default branch -#jobs: -# npm-publish: -# name: npm-publish -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@master -# - name: Set up Node.js -# uses: actions/setup-node@master -# with: -# node-version: 12.4.0 -# - name: Build library -# run: yarn install --frozen-lockfile && yarn run build -# - name: Publish if version has been updated -# uses: pascalgn/npm-publish-action@51fdb4531e99aac1873764ef7271af448dc42ab4 -# with: # All of theses inputs are optional -# tag_name: "v%s" -# tag_message: "v%s" -# commit_pattern: "^Release (\\S+)" -# env: # More info about the environment variables in the README -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated -# NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings name: Release on: diff --git a/CHANGELOG.md b/CHANGELOG.md index afd5392..f287634 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project 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). -## [dev] +## [2.0.1] #### Bugfixes - security update for bl dependency diff --git a/package.json b/package.json index 867100a..067850a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libp2p-noise", - "version": "2.0.0", + "version": "2.0.1", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", "files": [