build and test on release workflow #2
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: Main | |
on: | |
push: | |
branches: [ main ] | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
checks: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: "NPM Install, Build, and Cache" | |
id: npm-install-build-and-cache | |
uses: ./.github/actions/npm-install-build-and-cache | |
test: | |
name: Test and Lint | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: "Retrieve Dependencies and Build Artifacts" | |
id: retrieve-deps-and-build | |
uses: ./.github/actions/retrieve-deps-and-build | |
- name: Test | |
run: npm run test | |
summary: | |
name: Summary | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Summary | |
run: | | |
echo "Build: ${{ needs.build.result }}" | |
echo "Test/Lint: ${{ needs.test.result }}" | |
publish-experimental-packages: | |
name: Publish Experimental Packages | |
environment: experimental-package-release | |
needs: summary | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: "Retrieve Dependencies and Build Artifacts" | |
id: retrieve-deps-and-build | |
uses: ./.github/actions/retrieve-deps-and-build | |
- name: Publish | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "github-ci-mml" | |
npm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}" | |
./scripts/publish-experimental.sh | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |