-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (72 loc) · 2.13 KB
/
go.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Go CI
# Le workflow s'exécute sur chaque push ou pull request vers les branches principales
on:
workflow_dispatch:
inputs:
gosqlcleaner:
description: 'Version du build'
required: true
jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
# Vérifier le code depuis GitHub
- name: Checkout code
uses: actions/checkout@v3
# Installer Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.1' # Spécifiez ici la version de Go que vous utilisez
# Installer les dépendances Go (go.mod et go.sum doivent être présents)
- name: Install dependencies
run: |
go mod tidy
go mod download
- name: Build
run: go build -v .
- name: Archive
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
echo "GoSqlCleaner.exe"
else
echo "GoSqlCleaner"
fi
retention-days: 1
release:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-ubuntu-latest
path: GoSqlCleaner_ubuntu
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-macos-latest
path: GoSqlCleaner_macos
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-windows-latest
path: GoSqlCleaner_windows
- name: Creating release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.gosqlcleaner }}
name: ${{ github.event.inputs.gosqlcleaner }}
draft: false
prerelease: false
files: |
GoSqlCleaner_ubuntu
GoSqlCleaner_macos
GoSqlCleaner_windows
token: ${{ secrets.GITHUB_TOKEN }}