diff --git a/.github/workflows/publish-libs.yml b/.github/workflows/publish-libs.yml new file mode 100644 index 0000000000..6887e0bd1c --- /dev/null +++ b/.github/workflows/publish-libs.yml @@ -0,0 +1,57 @@ +name: Publish libs + +#on: +# release: +# types: [published] +on: + push: + branches: + - '**' +jobs: + publish: + name: Publish packages + runs-on: ubuntu-latest + strategy: + matrix: + package: + [ + { name: 'lib-apiclient' }, + { name: 'lib-auth' }, + { name: 'lib-aws' }, + { name: 'lib-components' }, + { name: 'lib-config' }, + { name: 'lib-db' }, + { name: 'lib-email' }, + { name: 'lib-function-helpers' }, + { name: 'lib-gameserver' }, + { name: 'lib-http' }, + { name: 'lib-modules' }, + { name: 'lib-queues' }, + { name: 'lib-util' }, + ] + + steps: + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@v1 + with: + app_id: ${{ secrets.TAKARO_CI_APP_ID }} + private_key: ${{ secrets.TAKARO_CI_APP_PRIV_KEY }} + + - name: Checkout code + uses: actions/checkout@v2 + with: + token: ${{ steps.generate_token.outputs.token }} + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.18 + cache: 'npm' + registry-url: 'https://npm.pkg.github.com' + + - run: ./scripts/dev-init.sh + + - run: npm -w ${{ matrix.package.name }} publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ steps.generate_token.outputs.token }}