ci: add release to gh per commit

This commit is contained in:
H01001000
2022-12-04 17:31:04 +08:00
parent a88e1e7402
commit 4a0e65cd99
18 changed files with 159 additions and 14 deletions

51
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Release
on:
push:
branches:
- main
- node-migration
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
package: ["bot", "gateway", "rest", "types", "utils"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://npm.pkg.github.com"
scope: '@discordeno'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --immutable
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-release-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-release-build-
- name: build Package
run: yarn release-build --cache-dir=".turbo"
- name: Bump Package Version
run: node /scripts/bumpVersionByCommit.js ${{ matrix.package }}
- run: npm publish
working-directory: packages/${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}