Skip to content

Commit

Permalink
Upload linux artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaloney111 committed Jun 17, 2024
1 parent 3a48169 commit f0df690
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 265 deletions.
90 changes: 57 additions & 33 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Rename AppImage file
run: mv dist/*.AppImage "dist/LinguifAI-${{ steps.project-version.outputs.version }}.AppImage"

- name: Upload Linux artifact
uses: actions/upload-artifact@v2
with:
name: LinguifAI-Linux
path: dist/*.AppImage



build-windows:
name: 🏗️ Build Windows
runs-on: windows-latest
Expand Down Expand Up @@ -100,38 +96,66 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Get latest release number
id: get_latest_release
uses: actions/github-script@v4
- name: Rename Windows installer
run: ren "dist\LinguifAI Setup ${{ steps.project-version.outputs.version }}.exe" "LinguifAI Setup ${{ steps.project-version.outputs.version }}.exe"

- name: Upload Windows artifact
uses: actions/upload-artifact@v2
with:
name: LinguifAI-Windows
path: dist/*.exe

publish-release:
name: 🚀 Publish Release
runs-on: ubuntu-latest
needs: [build-linux, build-windows]
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Linux artifact
uses: actions/download-artifact@v2
with:
name: LinguifAI-Linux
path: dist/

- name: Download Windows artifact
uses: actions/download-artifact@v2
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 newV = `${parseInt(versionParts[0])}.${parseInt(versionParts[1])}.${parseInt(versionParts[2]) + 1}`;
console.log(`::set-output name=new_version::${newV}`);
- name: Rename file
run: ren "dist\LinguifAI Setup ${{ steps.project-version-after.outputs.version }}.exe" "LinguifAI Setup ${{ steps.get_latest_release.outputs.new_version }}.exe"
name: LinguifAI-Windows
path: dist/

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
./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 }}
tag_name: v${{ steps.project-version.outputs.version }}
release_name: Release ${{ steps.project-version.outputs.version }}
draft: false
prerelease: true
body: ${{ github.event.head_commit.message }}

- name: Upload Linux artifact
id: upload-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/*.AppImage
asset_name: LinguifAI-${{ steps.project-version.outputs.version }}.AppImage
asset_content_type: application/octet-stream

- name: Upload Windows artifact
id: upload-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/*.exe
asset_name: LinguifAI-Setup-${{ steps.project-version.outputs.version }}.exe
asset_content_type: application/octet-stream
Loading

0 comments on commit f0df690

Please sign in to comment.