Skip to content
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

ci: fix publishing latest dist-tag for pre-releases #39

Merged
merged 16 commits into from
Oct 20, 2024
Merged
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
34 changes: 12 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -17,29 +17,19 @@ jobs:
- run: npm ci
- name: Extract version from tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Check for pre-release
id: check_pre_release
run: |
if [[ "${{ env.RELEASE_VERSION }}" == *-* ]]; then
echo "IS_PRE_RELEASE=true" >> $GITHUB_ENV
echo "RELEASE_TAG=next" >> $GITHUB_ENV
else
echo "IS_PRE_RELEASE=false" >> $GITHUB_ENV
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
fi
- run: npm version ${{ env.RELEASE_VERSION }} --no-git-tag-version
- run: npm run build
- run: npm publish
- name: Publish to npm
run: npm publish --tag ${{ env.RELEASE_TAG }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Commit and push version bump
run: |
git checkout -b version-bump/${{ env.RELEASE_VERSION }}
git add package.json
git commit -m "chore: bump version to ${{ env.RELEASE_VERSION }}"
git push origin version-bump/${{ env.RELEASE_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# This step will only run if all previous steps have succeeded
- name: Create Pull Request for Version Bump
if: success()
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update package version to ${{ env.RELEASE_VERSION }}
title: "chore: update package version to ${{ env.RELEASE_VERSION }}"
body: "Updates `package.json` version to `${{ env.RELEASE_VERSION }}`."
branch: version-bump/${{ env.RELEASE_VERSION }}
labels: version-bump
token: ${{ secrets.GITHUB_TOKEN }}
base: main
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,17 +16,17 @@ Furthermore, there are best practices we want to adhere to with our translated f

Keeli will help you automatically discover many problems with your translation files, including:

✅ Finds untranslated messages
✅ Finds empty messages
✅ Finds missing variables
✅ Finds accidentally translated variables
✅ Finds variable syntax errors
✅ Finds missing keys
✅ Finds unknown/un-balanced keys
✅ Finds keys violating your naming convention
✅ Finds extra whitespace
✅ Finds HTML in messages
✅ _...and more!_
- ✅ Finds untranslated messages
- ✅ Finds empty messages
- ✅ Finds missing variables
- ✅ Finds accidentally translated variables
- ✅ Finds variable syntax errors
- ✅ Finds missing keys
- ✅ Finds unknown/un-balanced keys
- ✅ Finds keys violating your naming convention
- ✅ Finds extra whitespace
- ✅ Finds HTML in messages
- ✅ _...and more!_

Most of these rules are configurable so you can customize keeli to your specific needs.

@@ -236,7 +236,7 @@ If you have the repo cloned locally, you can test run the CLI by running:

# Publishing

Create a GitHub release with the version number you want to create. Make sure the tag you create matches the version number (e.g., `v1.2.3`) and release! GitHub actions will take over and attempt to publish the package version you specified. Note that a Pull request will get opened on the repo automatically to bump the package version to align with the latest release. This PR should be merged ASAP after opened to keep things in sync.
Create a GitHub release with the version number you want to create. Make sure the tag you create matches the version number (e.g., `v1.2.3`) and release! GitHub actions will take over and attempt to publish the package version you specified.

---

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "keeli",
"version": "0.0.1",
"version": "0.0.0",
"main": "dist/index.js",
"description": "Configurable CLI validation tool to check for common problems in your translated source files.",
"author": {