Skip to content

Commit

Permalink
zip distributables
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolshres98 committed Jan 17, 2025
1 parent d59b112 commit f54d487
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/create-github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout branch
- name: Checkout tag
uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # checkouts the branch that triggered the workflow
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: pnpm install

- name: Configure git
run: |
git config --local user.email [email protected]
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/publish-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: pnpm install

Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/scripts/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ else
echo "Package directory was determined as: $packageDirectory"
fi
changelogMd="$packageDirectory/CHANGELOG.md"
cd $packageDirectory
changelogMd="CHANGELOG.md"
if [ ! -f "$changelogMd" ]; then
echo "Changelog file not found: $changelogMd"
exit 1
fi
# build the package and create consumable to release
pnpm build
# Extract the changelog text
releaseNoteText=$(awk -v version="$packageVersion" '$0 ~ version {flag=1; print; next} /^## /{flag=0} flag' "$changelogMd")
echo "Release note text was extracted as: $releaseNoteText"
Expand All @@ -51,8 +55,8 @@ zipFileName=$(echo "$tagName" | sed 's/@itwin\///; s/@bentley\///')
echo "Zip file name was parsed as: $zipFileName"
# Zip the package directory with just the specific package
zip -r "$zipFileName.zip" "$packageDirectory"
tar -czvf "$zipFileName.tar.gz" "$packageDirectory"
zip -r "$zipFileName.zip" lib dist
tar -czvf "$zipFileName.tar.gz" lib dist
# Create a release and upload assets
gh release create "$tagName" \
Expand Down

0 comments on commit f54d487

Please sign in to comment.