Skip to content

Commit

Permalink
Update develop.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaloney111 authored Jun 10, 2024
1 parent 06c242a commit dad1416
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,36 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Get version of the project
id: project-version-after
uses: 'euberdeveloper/ga-project-version@main'

- name: Rename file
run: |
$old_name = Get-ChildItem -Path dist -Filter 'LinguifAI Setup*.exe' | Select-Object -ExpandProperty Name
$new_name = "LinguifAI Setup ${{ steps.project-version-after.outputs.version }}.exe"
Rename-Item -Path "dist\$old_name" -NewName $new_name
- name: Get latest release number
id: get_latest_release
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const response = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 10
});
const latestPreRelease = response.data[0];
const preReleaseTag = latestPreRelease.name;
const versionParts = preReleaseTag.replace(/^v/, '').split('.');
const newVersion = `${parseInt(versionParts[0])}.${parseInt(versionParts[1])}.${parseInt(versionParts[2]) + 1}`;
ren "dist\LinguifAI Setup ${{ steps.get_latest_release.outputs.new_version }}.exe" "LinguifAI Setup ${{ newVersion }}.exe"
console.log(`::set-output name=new_version::${newVersion}`);
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
./dist/LinguifAI\ Setup\ ${{ env.NEW_VERSION }}.exe
tag_name: v${{ env.NEW_VERSION }}
name: v${{ env.NEW_VERSION }}
./dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe
tag_name: v${{ steps.get_latest_release.outputs.new_version }}
name: v${{ steps.get_latest_release.outputs.new_version }}
prerelease: true
body: ${{ github.event.head_commit.message }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dad1416

Please sign in to comment.