Go CI #5
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: 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@v2 | |
with: | |
name: build-${{ matrix.os }} | |
path: GoSqlCleaner | |
retention-days: 1 | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-ubuntu-latest | |
path: GoSqlCleaner_ubuntu | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-macos-latest | |
path: GoSqlCleaner_macos | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
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 }} | |