Skip to content

Commit

Permalink
תיקון פעולת שחרור גרסאות ידניצ
Browse files Browse the repository at this point in the history
  • Loading branch information
NHLOCAL committed Oct 25, 2024
1 parent 15e02cd commit 1194f54
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions .github/workflows/publish-installer-ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}

Expand Down Expand Up @@ -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 }}
Expand All @@ -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

0 comments on commit 1194f54

Please sign in to comment.