Update build-linux.yml #8
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
name: Build and Release QChatGPT for Linux | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16.x' | |
- name: Install dependencies | |
run: npm install | |
- name: Install Quasar CLI | |
run: npm install -g @quasar/cli | |
- name: Build Quasar Electron App | |
run: quasar build -m electron | |
- name: Create ZIP Archive | |
run: | | |
cd dist/electron/Packaged | |
zip -r QChatGPT-linux-x64.zip QChatGPT-linux-x64 | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: qchatgpt | |
path: dist/electron/Packaged/QChatGPT-linux-x64.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16.x' | |
- name: Get version from package.json | |
id: get_version | |
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: qchatgpt | |
path: dist/electron/Packaged | |
- name: Setup gh CLI | |
run: | | |
sudo apt-get install -y jq | |
curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r '.assets[] | select(.name | match("linux_amd64.deb$")) | .browser_download_url' | xargs sudo dpkg -i | |
- name: Authenticate gh CLI | |
env: | |
GH_TOKEN: ${{ secrets.PAT_TOKEN }} | |
run: gh auth login --with-token <<< $GH_TOKEN | |
- name: Create Release | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
run: | | |
gh release create v${{ env.VERSION }} dist/electron/Packaged/QChatGPT-linux-x64.zip -t "Release v${{ env.VERSION }}" -n "Release v${{ env.VERSION }}" --target main --draft=false --prerelease=false | |
- name: Publish Release | |
env: | |
GH_TOKEN: ${{ secrets.PAT_TOKEN }} | |
run: gh release edit "v${{ env.VERSION }}" --draft=false |