Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added workflow to release csm libs #87

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/csm-release-libs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0

# This workflow is used to release libraries like gobrick, gofsutil etc.
name: Release Libs
harishp8889 marked this conversation as resolved.
Show resolved Hide resolved

# Invocable as a reusable workflow
on:
workflow_call:
harishp8889 marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:
inputs:
version:
description: 'Version to release (major, minor, patch)'
required: true
default: 'none'

jobs:
build-and-scan:
name: Build,Scan and Release
harishp8889 marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Install dependencies
run: go mod tidy
- name: Build
run: go build -v ./...
- name: Run malware scan
uses: dell/common-github-actions/malware-scanner@main
with:
directories: .
options: -ri

- name: Create new tag
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}

- name: Create GitHub release
uses: actions/create-release@v1
harishp8889 marked this conversation as resolved.
Show resolved Hide resolved
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: false
prerelease: false
body: |
## Changes
- Describe your changes here
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release branch
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git checkout -b release/v${{ github.event.inputs.version }}
git push origin release/v${{ github.event.inputs.version }}