Skip to content

Commit

Permalink
build and upload artefact to release with gh-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
bfritscher committed Jan 22, 2024
1 parent afd9515 commit a31f01c
Showing 1 changed file with 11 additions and 74 deletions.
85 changes: 11 additions & 74 deletions .github/workflows/release_tags.yml
Original file line number Diff line number Diff line change
@@ -1,105 +1,42 @@
name: Quasar Electron Build and Release

on:
push:
tags:
- v*
jobs:
release:
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
types:
- published
jobs:
build-linux:
runs-on: ubuntu-latest
needs: [release]
steps:
- uses: actions/checkout@v3
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Setup NodeJS Environment
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
- run: yarn install && npm -g install @quasar/cli
- run: quasar build --mode electron --target darwin --target linux
- run: zip -r ./Typesense-Dashboard-linux-x64-${{ github.ref_name }}.zip ./dist/electron/Typesense-Dashboard-linux-x64
- run: zip -r ./Typesense-Dashboard-darwin-x64-${{ github.ref_name }}.zip ./dist/electron/Typesense-Dashboard-darwin-x64
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
env:
TAG_REF_NAME: ${{ github.ref }}
REPOSITORY_NAME: ${{ github.repository }}
- name: Upload a Release Asset linux
uses: actions/upload-release-asset@v1.0.2
run: gh release upload ${{ github.ref_name }} ./Typesense-Dashboard-linux-x64-${{ github.ref_name }}.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./Typesense-Dashboard-linux-x64-${{ github.ref_name }}.zip
asset_name: Typesense-Dashboard-linux-x64-${{ github.ref_name }}.zip
asset_content_type: appliction/zip
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload a Release Asset darwin
uses: actions/upload-release-asset@v1.0.2
run: gh release upload ${{ github.ref_name }} ./Typesense-Dashboard-darwin-x64-${{ github.ref_name }}.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./Typesense-Dashboard-darwin-x64-${{ github.ref_name }}.zip
asset_name: Typesense-Dashboard-darwin-x64-${{ github.ref_name }}.zip
asset_content_type: appliction/zip
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-windows:
runs-on: windows-latest
needs: [release]
steps:
- uses: actions/checkout@v3
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Setup NodeJS Environment
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
- run: yarn install && npm -g install @quasar/cli electron-installer-zip
- run: quasar build --mode electron --target win32
- run: electron-installer-zip ./dist/electron/Typesense-Dashboard-win32-x64 ./Typesense-Dashboard-win32-x64-${{ github.ref_name }}.zip
- name: Get Release File Name & Upload URL
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
env:
TAG_REF_NAME: ${{ github.ref }}
REPOSITORY_NAME: ${{ github.repository }}
- name: Upload a Release Asset win32
uses: actions/upload-release-asset@v1.0.2
run: gh release upload ${{ github.ref_name }} ./Typesense-Dashboard-win32-x64-${{ github.ref_name }}.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./Typesense-Dashboard-win32-x64-${{ github.ref_name }}.zip
asset_name: Typesense-Dashboard-win32-x64-${{ github.ref_name }}.zip
asset_content_type: appliction/zip
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a31f01c

Please sign in to comment.