Go CI/CD Pipeline for Release #2
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: | |
# Utilisation de la machine virtuelle ubuntu-latest | |
runs-on: ubuntu-latest | |
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: 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: | | |
package/linux/* | |
package/windows/* | |
token: ${{ secrets.GITHUB_TOKEN }} | |