CI #8
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
on: | ||
workflow_dispatch: | ||
# Release a new version with git tag, GitHub release + artifact uploading | ||
name: CI | ||
jobs: | ||
Build-Release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
# Update project version via npm. Dicards "v" prefix | ||
- name: Update project version | ||
id: update-version | ||
run: | | ||
export newVersion=$(npm --no-git-tag-version version patch) | ||
echo "NEW_VERSION=${newVersion:1}" >> "$GITHUB_ENV" | ||
# Build project (keep it simple) | ||
- name: Build project | ||
run: npm install && npm run build | ||
# Commit and push new release while retrieving commit hash | ||
# that will be used to create tag in next step | ||
- name: Commit & push new version with tag | ||
id: push-new-version-with-tag | ||
run: | | ||
git config --global user.name 'gh-action' | ||
git config --global user.email '[email protected]' | ||
git commit -am "Release $NEW_VERSION" | ||
git push | ||
echo "NEW_COMMIT_SHA=$(git rev-parse HEAD)" >> "$GITHUB_ENV" | ||
git tag -a "$NEW_VERSION" -m "Release $NEW_VERSION" | ||
git push origin --tags | ||
- name: Create new release + upload build artifact | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: ${{ NEW_VERSION }} | ||
Check failure on line 41 in .github/workflows/ci.yml
|
||
# Use empty description because we have nothing to say! | ||
body: "" | ||
tag_name: ${{ NEW_VERSION }} | ||
target_commitish: ${{ NEW_COMMIT_SHA }} | ||
files: dist/habitica-equipment-tracker/browser/**/* | ||
fail_on_unmatched_files: true | ||