Output Targets Build #68
Workflow file for this run
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: 'Output Targets Build' | |
on: | |
workflow_dispatch: | |
jobs: | |
dev-build: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.dev-build.outputs.version }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 | |
with: | |
version: 8 | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version: '20.10.0' | |
cache: 'pnpm' | |
- name: Install Dependencies | |
run: pnpm install | |
shell: bash | |
- name: Prepare NPM Token | |
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc | |
shell: bash | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# A 1 is required before the timestamp | |
# as lerna will fail when there is a leading 0 | |
# See https://github.com/lerna/lerna/issues/2840 | |
- name: Create Dev Hash | |
run: | | |
echo "HASH=1$(git log -1 --format=%H | cut -c 1-7)" >> $GITHUB_ENV | |
echo "TIMESTAMP=1$(date +%s)" >> $GITHUB_ENV | |
shell: bash | |
- name: Create Dev Build | |
run: | | |
HUSKY_SKIP_HOOKS=1 lerna publish 0.0.1-dev.$(echo "${{ env.TIMESTAMP }}").$(echo "${{ env.HASH }}") --no-verify-access --yes --force-publish='*' --dist-tag dev --no-git-tag-version --no-push --exact | |
shell: bash | |
- id: dev-build | |
run: echo "::set-output name=version::0.0.1-dev.$(echo "${{ env.TIMESTAMP }}").$(echo "${{ env.HASH }}")" | |
get-build: | |
name: Get your dev build! | |
runs-on: ubuntu-latest | |
needs: dev-build | |
steps: | |
- run: echo ${{ needs.dev-build.outputs.version }} |