Skip to content

Commit

Permalink
Create ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Blockost authored Dec 7, 2024
1 parent cc47e34 commit b893915
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
workflow_dispatch:

# Release a new version with git tag, Github release + artifact uploading
name: CI

jobs:

build:
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 ::set-output name=newVersion::${newVersion:1}
# 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
id: push-new-version
run: |
git config --global user.name 'gh-action'
git config --global user.email '[email protected]'
git commit -am "Release ${{ steps.update-version.outputs.newVersion }}"
git push
echo ::set-output name=newCommitSha::$(git rev-parse HEAD)
- name: Create new release + upload build artifact
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.update-version.outputs.newVersion }}
# Use empty description because we have nothing to say!
body: ""
tag_name: ${{ steps.update-version.outputs.newVersion }}
target_commitish: ${{ steps.push-new-version.outputs.newCommitSha }}
files: dist/habitica-equipment-tracker/browser
fail_on_unmatched_files: true



0 comments on commit b893915

Please sign in to comment.