-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # נדרש כדי לאפשר יצירת תגיות חדשות | ||
fetch-depth: 0 # נדרש כדי לאפשר יצירת תגיות ושחרורים | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
|
@@ -44,10 +44,14 @@ jobs: | |
- name: Create Tag (if manually triggered) | ||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' }} | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git tag v${{ steps.get_version.outputs.VERSION }} | ||
git push origin v${{ steps.get_version.outputs.VERSION }} | ||
if git rev-parse "v${{ steps.get_version.outputs.VERSION }}" >/dev/null 2>&1; then | ||
echo "Tag v${{ steps.get_version.outputs.VERSION }} כבר קיים. דילוג על יצירת תג." | ||
else | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git tag v${{ steps.get_version.outputs.VERSION }} | ||
git push origin v${{ steps.get_version.outputs.VERSION }} | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -115,9 +119,31 @@ jobs: | |
Copy-Item -Recurse src\core\app portable\ | ||
Copy-Item -Recurse src\core\models portable\ | ||
Copy-Item -Recurse src\core\assets portable\ | ||
Compress-Archive -Path portable\* -DestinationPath Singles-Sorter-Portable-${{ steps.get_version.outputs.VERSION }}.zip -CompressionLevel Optimal | ||
Compress-Archive -Path portable\* -DestinationPath Singles-Sorter-Portable-AI-${{ steps.get_version.outputs.VERSION }}.zip -CompressionLevel Optimal | ||
- name: Check if Release Exists | ||
id: check_release | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const tag = 'v${{ steps.get_version.outputs.VERSION }}'; | ||
const releases = await github.rest.repos.listReleases({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
per_page: 100 | ||
}); | ||
const release = releases.data.find(r => r.tag_name === tag); | ||
if (release) { | ||
core.setOutput('exists', 'true'); | ||
core.setOutput('release_id', release.id); | ||
} else { | ||
core.setOutput('exists', 'false'); | ||
} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Release | ||
- name: Create Release (if not exists) | ||
if: steps.check_release.outputs.exists == 'false' | ||
uses: softprops/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -129,3 +155,14 @@ jobs: | |
files: | | ||
Output/Singles-Sorter-Installer-AI-${{ steps.get_version.outputs.VERSION }}.exe | ||
Singles-Sorter-Portable-AI-${{ steps.get_version.outputs.VERSION }}.zip | ||
- name: Upload Assets to Existing Release | ||
if: steps.check_release.outputs.exists == 'true' | ||
uses: softprops/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: "v${{ steps.get_version.outputs.VERSION }}" | ||
files: | | ||
Output/Singles-Sorter-Installer-AI-${{ steps.get_version.outputs.VERSION }}.exe | ||
Singles-Sorter-Portable-AI-${{ steps.get_version.outputs.VERSION }}.zip |