Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release from artifact #65

Closed
Mara-Li opened this issue Feb 15, 2022 · 0 comments
Closed

Release from artifact #65

Mara-Li opened this issue Feb 15, 2022 · 0 comments

Comments

@Mara-Li
Copy link

Mara-Li commented Feb 15, 2022

Hello !
I try to release artifact from a python build but the actions doesn't release the good files.
My github action is :

name: Build

on:
  push:
    branches:
      - main

defaults:
  run:
    shell: bash
jobs:
  Build:
    name: Build release binaries

    strategy:
      fail-fast: false
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.10.0

      - name: Install Python dependencies Without MacOS
        if: matrix.os != 'macos-latest'
        run: |
          python -m pip install --upgrade pip pyinstaller
          pip install -r requirements.txt
      - name: Build windows
        if: matrix.os == 'windows-latest'
        run: pyinstaller Obsidian_Snippeter/GUI.py --name "${{matrix.os}}-Manager" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*;Obsidian_Snippeter/src/gui_bin/' --distpath app
      - name: Build Ubuntu
        if: matrix.os == 'ubuntu-latest'
        run: pyinstaller Obsidian_Snippeter/GUI.py --name "${{matrix.os}}-Manager" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*:Obsidian_Snippeter/src/gui_bin/' --distpath app
      - name: Build MacOS
        if: matrix.os == 'macos-latest'
        run: |
          brew install python-tk@3.9 && echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc && echo -n 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
          pip install pyinstaller
          pip install -r requirements.txt
          pyinstaller Obsidian_Snippeter/GUI.py --name "${{matrix.os}}-Manager" --windowed --i Obsidian_Snippeter/src/gui_bin/hand.ico --noconfirm --add-data 'Obsidian_Snippeter/src/gui_bin/*:Obsidian_Snippeter/src/gui_bin/' --distpath app
          
      - name: Deploy artifacts
        uses: actions/upload-artifact@v2
        with:
          name: app-${{ matrix.os }}
          path: app/${{ matrix.os }}-Manager
          if-no-files-found: error

      - name: Create release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: app/${{matrix.os}}-Manager
          asset_name: Obsidian_Snippet_Manager
          tag: ${{ github.ref }}
          body: "Release ${{ github.ref }}"

Anyone can help me ?

@Mara-Li Mara-Li closed this as completed Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant