Github "C/ C++ with Make" Workflow doesn't produce artifact

149 views Asked by At

I am trying to build a simple app using make. GitHub has a workflow template, "C/C++ with make" and I was able to format the build instructions from the repo without too much trouble. When I ran the action, it completed successfully, but it did not create any artifacts. I would expect that running make would produce an artifact file (I have forked other repos with existing app-building actions, and I was able to find the compiled .exe in the artifacts after running those actions. It's just this action that I wrote myself that I'm having trouble with.)

To be clear, when I reference "artifacts", I am referring to how after running a workflow, you can view its results at github.com/{username}/{repoName}/actions/runs/{runNumber}, where there are separate boxes (if applicable) for annotations and artifacts. You can click to download files from the artifacts box. I'm not concerned about pushing files to the repo.

The original build instructions are:

sudo apt install make gcc qtmultimedia5-dev libogg-dev libopus-dev libgl1-mesa-dev build-essential libssl-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc-multilib qttools5-dev-tools
find ./ -name '*.ts' -exec lrelease {} \;
qmake buildme.pro
make -j$(nproc)

And my Build.yml code is:

name: Build

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: update outdated dependei
      run: sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
    - name: apt update
      run: sudo apt-get update
    - name: install dependencies
      run: sudo apt install -y --fix-missing make gcc qtmultimedia5-dev libogg-dev libopus-dev libgl1-mesa-dev build-essential libssl-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gcc-multilib qttools5-dev-tools
    - name: find file 
      run: find ./ -name '*.ts' -exec lrelease {} \;
    - name: qmake
      run: qmake buildme.pro
    - name: make
      run: make -j$(nproc)

And you can find the logs for the make command on pastebin

I will admit I'm not familiar enough with make or qmake to know if I need to add further instructions in order to get an executable file as a result. Am I missing something?

1

There are 1 answers

12
Doj On

Your action does not upload any artifacts. You can use actions/upload-artifact to do that:

    - uses: actions/upload-artifact@v3
      with:
        name: program.exe
        path: "path/to/program.exe"