Skip to content

WIP: getting SHA number #5447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": [],
"snapshot": {
"useCalculatedVersion": true,
"prereleaseTemplate": "{tag}.{datetime}"
}
}
71 changes: 39 additions & 32 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Beta Release

on:
pull_request:
types: [opened, synchronize]

push:
branches:
- main
Expand All @@ -13,36 +16,40 @@ jobs:
- name: Checkout PR branch
uses: actions/checkout@v4

- name: Setup Job and Install Dependencies
uses: ./.github/actions/setup-job

- name: Set Git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions-bot"

- name: Update package versions for beta release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn changeset pre enter beta
# Apply the changeset with specific beta tag
yarn changeset version
yarn lint:versions --fix
yarn update-version

- name: Configure NPM for changeset publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish beta release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Test tag format
run: |
git add .
git commit -am "chore: publish beta version"
yarn prepublishOnly
yarn changeset publish --no-git-tag
git reset --hard HEAD^
echo "Full SHA: $GITHUB_SHA"
echo "Short SHA: ${GITHUB_SHA::8}"
echo "Tag would be: beta-${GITHUB_SHA::8}"

# - name: Setup Job and Install Dependencies
# uses: ./.github/actions/setup-job

# - name: Set Git identity
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "github-actions-bot"

# - name: Update package versions for beta snapshot release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# yarn changeset version --snapshot beta
# yarn lint:versions --fix
# yarn update-version

# - name: Configure NPM for changeset publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

# - name: Publish beta snapshot release
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: |
# git add .
# git commit -am "chore: publish beta snapshot version"
# yarn prepublishOnly
# yarn changeset publish --no-git-tag --tag beta-${GITHUB_SHA::8}
# git reset --hard HEAD^
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"build:ts:watch": "wireit",
"build:types": "wireit",
"build:watch": "wireit",
"changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag --tag snapshot",
"changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot snapshot && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag --tag snapshot",
"changeset-publish": "yarn prepublishOnly && yarn changeset version && yarn install && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag && yarn push-to-remote && yarn create-git-tag && yarn postpublish",
"update-version": "node ./tasks/update-version.js",
"chromatic": "chromatic --build-script-name storybook:build # note that --project-token must be set in your env variables",
Expand Down
Loading