-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (49 loc) · 1.71 KB
/
c-cpp.yml
File metadata and controls
58 lines (49 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: C/C++ CI with Release
on:
push:
branches: [ "main" ] # build normal ao push na main
tags: # novo: dispara quando uma tag for criada
- 'v*' # tags que começam com v (ex: v1.0.0)
pull_request:
branches: [ "main" ] # build para PRs (sem release)
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install NASM
run: |
sudo apt-get update
sudo apt-get install -y nasm
- uses: actions/checkout@v4
- name: Compilar com make
run: make
# (Opcional) Se você quiser armazenar o binário gerado para usar em outro job,
# pode fazer upload como artefato. Exemplo:
- name: Upload binário como artefato
uses: actions/upload-artifact@v4
with:
name: disk.img # nome do artefato
path: ./build/disk.img # ⚠️ ajuste para o caminho real do seu binário
# Exemplo: path: ./meu_programa
# Job separado para criar a release (executa somente quando for uma tag)
release:
needs: build # só executa se o build passar
if: startsWith(github.ref, 'refs/tags/v') # só roda para tags v*
runs-on: ubuntu-latest
steps:
- name: Baixar artefato do job build
uses: actions/download-artifact@v4
with:
name: disk.img # mesmo nome usado no upload
path: ./build/
- name: Criar Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
body: |
first bin build
draft: false
prerelease: false
files: ./build/* # anexa todos os arquivos da pasta artefatos
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}