diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6098b8e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-npm- + - name: Install dependencies + run: npm i + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/package.json b/package.json index 674006d..2133f06 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,9 @@ "ws": "^7.4.5" }, "devDependencies": { + "@webtorrent/semantic-release-config": "^1.0.5", "magnet-uri": "6.2.0", + "semantic-release": "^17.4.3", "standard": "*", "tape": "5.2.2", "webtorrent-fixtures": "1.7.3", @@ -98,5 +100,8 @@ "extends": [ "github>webtorrent/renovate-config" ] + }, + "release": { + "extends": "@webtorrent/semantic-release-config" } }