Test workflows (#61) #56
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: 'Publish alpha releases' | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
name: Publish ${{ matrix.package }} to NPM (Alpha) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: [react, vanilla] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
registry-url: https://registry.npmjs.org/ | |
- name: Set hash and version variable | |
run: | | |
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Build packages | |
run: | | |
npm ci | |
npm run build:packages | |
- name: Publish package | |
working-directory: ./packages/${{ matrix.package }}s | |
run: | | |
echo "Preparing to publish ${{ matrix.package }} package" | |
echo "VERSION=$(npm view ./ version)" >> $GITHUB_ENV | |
echo "RELEASE_VERSION=$(npm view ./ version)-alpha.$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
echo "VERSION: ${{ env.VERSION }}" | |
echo "COMMIT_HASH: ${{ env.COMMIT_HASH }}" | |
echo "RELEASE_VERSION: ${{ env.RELEASE_VERSION }}" | |
# npm version ${{ env.VERSION }}-alpha.${{ env.COMMIT_HASH }} --no-git-tag-version | |
# npm publish --tag alpha --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |