chore(main): release @trey.turner/artifacts-cli 0.0.1 (#15) #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test-and-build: | |
name: main | |
uses: ./.github/workflows/test-build.yaml | |
secrets: inherit | |
permissions: | |
contents: read | |
id-token: write | |
release-please: | |
name: Release Automation | |
runs-on: ubuntu-latest | |
needs: [test-and-build] | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.RELEASE_PLEASE_TOKEN }} | |
- uses: actions/github-script@v7 | |
id: get-released-pkgs | |
env: | |
PATHS_RELEASED: ${{ steps.release.outputs.paths_released }} | |
PUBLISHABLE_PKGS: ${{ vars.PUBLISHABLE_PKGS }} | |
with: | |
script: | | |
const { PATHS_RELEASED, PUBLISHABLE_PKGS } = process.env; | |
const paths = JSON.parse(PATHS_RELEASED); | |
const pubs = JSON.parse(PUBLISHABLE_PKGS); | |
const pkgs = paths.map(path => path.split('/').at(1)); | |
return pkgs.filter(pkg => pubs.includes(pkg)); | |
outputs: | |
pkgs-released: ${{ steps.get-released-pkgs.outputs.result }} | |
publish: | |
name: Publish | |
if: ${{ needs.release-please.outputs.pkgs-released != '[]' }} | |
runs-on: ubuntu-latest | |
needs: [release-please] | |
strategy: | |
matrix: | |
package: ${{ fromJson(needs.release-please.outputs.pkgs-released) }} | |
defaults: | |
run: | |
working-directory: packages/${{ matrix.package }} | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version-file: ".bun-version" | |
- run: bun install --frozen-lockfile | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.package }}-dist | |
path: packages/${{ matrix.package }}/dist | |
- name: publish ${{ matrix.package }} | |
run: npm publish --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |