Skip to content

Commit

Permalink
setup workfolw
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostflyby committed Feb 23, 2024
1 parent bb61a91 commit fa3dafb
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "tagged-release"

on:
push:
paths:
- 'manifest.json'

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"

steps:
- name: "Checkout Repository"
uses: "actions/checkout@v4"
with:
fetch-depth: 2 # Ensure we can get the previous version

- name: "Read versions from manifest"
id: read-versions
run: |
version=$(cat manifest.json | jq -r .version)
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Version: $version"
previous_version=$(git show HEAD^:manifest.json | jq -r .version)
echo "previous-version=previous_version$" >> "$GITHUB_OUTPUT"
echo "Previous version: $previous_version"
- name: "pnpm build"
if: ${{ steps.read-versions.outputs.version != steps.read-versions.outputs.previous-version }}
run: |
echo "Building the project..."
pnpm install
pnpm run build
echo "Done!"
- name: "Zip release files" # Only if the version has been updated
if: ${{ steps.read-versions.outputs.version != steps.read-versions.outputs.previous-version }}
run: |
echo "Creating a release zip file..."
zip -r "${{github.event.repository.name}}-release.zip" dist/ LICENSE README.md manifest.json
echo "Done!"
- name: "Create Release"
if: ${{ steps.read-versions.outputs.version != steps.read-versions.outputs.previous-version }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "${{ steps.read-versions.outputs.version }}"
title: "${{ steps.read-versions.outputs.version }}"
files: |
"${{github.event.repository.name}}-release.zip"
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"branch": "main",
"release": {
"tag": "0.1.0",
"file": "release.zip"
"file": "LiteLoaderQQNT-Native-Menu-release.zip"
}
}
}

0 comments on commit fa3dafb

Please sign in to comment.