This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 3
update ts actions #143
Merged
Merged
update ts actions #143
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
22e4e82
update ts actions
nitro-neal 8d8106b
update
nitro-neal 264b7a1
update
nitro-neal 029d55f
update justfile
nitro-neal 80d59a0
revert
nitro-neal c6d3e8a
update
nitro-neal 22385d8
updates
nitro-neal f7191e2
works on linux
nitro-neal b34ffbc
update
nitro-neal 7d1d1aa
back to mac
nitro-neal 78da8c0
roll back build.sh
nitro-neal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Release TypeScript Package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version of the TypeScript package to release and publish to npm. For example "1.0.0" or "1.3.7-beta-2". Required. Must not end in "-SNAPSHOT".' | ||
required: true | ||
|
||
jobs: | ||
# Job to set the version and create a git tag | ||
set-version-and-tag: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
RELEASE_TAG: ${{ steps.set-version-and-tag.outputs.RELEASE_TAG }} | ||
RELEASE_VERSION: ${{ steps.set-version-and-tag.outputs.RELEASE_VERSION }} | ||
steps: | ||
# Check out the repository with permissions to push | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.TBD_RELEASE_GITHUB_PERSONAL_ACCESS_TOKEN }} | ||
|
||
# Set Git configuration for committing | ||
- name: Set Git Config | ||
run: | | ||
git config user.name "tbd-releases" | ||
git config user.email "[email protected]" | ||
|
||
# Update version, commit, and tag | ||
- name: Set Version and Tag | ||
id: set-version-and-tag | ||
run: | | ||
version="${{ github.event.inputs.version }}" | ||
if [[ "$version" == *"-SNAPSHOT" ]]; then | ||
echo "Error: The version for release must not end with \"-SNAPSHOT\": $version" | ||
exit 1 | ||
fi | ||
cd bound/typescript | ||
npm version "$version" --no-git-tag-version | ||
git add package.json package-lock.json | ||
git commit -m "[TBD Release Manager 🚀] Setting version to: $version" | ||
tagName="ts-v$version" | ||
git tag -a "$tagName" -m "Tag version: $tagName" | ||
echo "RELEASE_TAG=$tagName" >> $GITHUB_OUTPUT | ||
echo "RELEASE_VERSION=$version" >> $GITHUB_OUTPUT | ||
git push origin "${GITHUB_REF#refs/heads/}" | ||
git push origin "$tagName" | ||
|
||
# Job to build, test, and publish the package | ||
build-and-publish: | ||
name: Build and Publish TypeScript Package | ||
needs: set-version-and-tag | ||
runs-on: macos-latest | ||
steps: | ||
# Check out the code at the release tag | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.set-version-and-tag.outputs.RELEASE_TAG }} | ||
token: ${{ secrets.TBD_RELEASE_GITHUB_PERSONAL_ACCESS_TOKEN }} | ||
|
||
# Initialize Hermit environment | ||
- name: Init Hermit | ||
uses: cashapp/activate-hermit@v1 | ||
with: | ||
cache: true | ||
|
||
# Install dependencies | ||
- name: Install Dependencies | ||
run: | | ||
cd bound/typescript | ||
npm install | ||
|
||
# Build the package | ||
- name: Build TypeScript Package | ||
run: | | ||
cd bound/typescript | ||
npm run clean | ||
npm run build | ||
|
||
# Run tests | ||
- name: Run Tests | ||
run: | | ||
cd bound/typescript | ||
npm run test:node:cjs | ||
npm run test:node:esm | ||
|
||
# Publish to npm | ||
- name: Publish to npm | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
cd bound/typescript | ||
npm publish --access public | ||
|
||
# Create a GitHub release | ||
- name: Create GitHub Release | ||
uses: actions/[email protected] | ||
with: | ||
tag_name: ${{ needs.set-version-and-tag.outputs.RELEASE_TAG }} | ||
release_name: ${{ needs.set-version-and-tag.outputs.RELEASE_TAG }} | ||
body: "Release of TypeScript package version ${{ needs.set-version-and-tag.outputs.RELEASE_VERSION }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on just
tbdex
? Looks like npm doesn't support@tbdex
because the@
is a scope which must be followed by package name, but we could be daring and just dotbdex
, right?