Skip to content

Merge pull request #6 from drazenbuljovcic/async/proxy #39

Merge pull request #6 from drazenbuljovcic/async/proxy

Merge pull request #6 from drazenbuljovcic/async/proxy #39

name: Publish RC
on:
push:
tags:
- "*"
pull_request:
branches:
- "*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Bun
uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run build
- name: Read package.json
id: package_version
# package-version
run: |
echo "::set-output name=package-version::$(node -p "require('./package.json').version")"
echo "package version: ${{ steps.package_version.outputs.package-version }}"
- name: Read rc version
id: read_commit
# rc-version
run: |
echo "Reading RC"
echo "::set-output name=rc-version::$(git log -1 --pretty=%H)"
echo "rc version: ${{ steps.package_version.outputs.rc-version }}"
- name: Use the GitHub Token
run: echo "My GitHub token is ${{ secrets.GH_PAT }}"
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Git
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- name: Authenticate npm
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}
- name: Tag release
run: |
echo "the package version would be"
echo "${{ steps.package_version.outputs.rc-version }}"
# TODO tag release action
# git tag v${{ steps.package_version.outputs.rc-version }}
# git push origin v${{ steps.package_version.outputs.rc-version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish
run: |
npm publish --access public
echo ${{ secrets.NPM_AUTH_TOKEN }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}