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

Add Go Driver Actions #26

Closed
blink1073 opened this issue Jun 8, 2024 · 3 comments
Closed

Add Go Driver Actions #26

blink1073 opened this issue Jun 8, 2024 · 3 comments

Comments

@blink1073
Copy link
Member

blink1073 commented Jun 8, 2024

Re-use existing pieces

Bump Version (new top level)

Since we'll need flexibility to set prerelease and major versions, use the same bump action as python, but add option for the commit message

  • Accepts a script to call to bump the version that takes the version as the first argument
  • Update version
  • Create signed commit
  • Push Commit unless dry run

Tag Version (new top level)

Use the same tag action as python, but add tag template and tag message template.

  • Create signed tag
  • Push tag unless dry run

Generate Reports (new top level)

Separate out this portion of the python publish to handle the SSDLC reports

  • Create SBOM
  • Create SARIF
  • Create authorized pub (with no files for go)
  • Create compliance report
  • Upload to S3 unless dry run

Go-specifc

Go Prep Release

  • Run bump version
  • Run tag version

Go Release

  • Call Generate Reports Action
  • Create github.md and forum.md using notes.go
  • Create draft release with github.md as body unless dry run
  • Print forum.md as part of job output
  • Print draft release url as part of job output
  • Bump prelease version

Then the workflow in the Go Driver repo will:

  • Accept next and prerelease version as input
  • Go Prep Release Action
  • Run CodeQL using workflow_call against the new version
  • Run Go Release Action

The user will choose which branch to release from, and the two versions


Python-specific

For the Python Driver, we have:

Python Prep Release (new)

  • Run bump version
  • Run tag version

Python Dist (new)

  • Download and sign dist files

Python Release (replaces python publish)

  • Call Python Dist Action
  • Call Generate Reports Action
  • Publish to pypi unless dry run
  • Create draft release unless dry run
  • Bump following version

Then the workflow in the Python Driver repos will:

  • Accept next and prerelease version as input
  • Python Prep Release Action
  • Run Dist workflow using workflow_call
  • Run CodeQL using workflow_call against the new version
  • Run Python Release Action

The user will choose which branch to release from, and the two versions

@blink1073
Copy link
Member Author

cc @matthewdale

@blink1073
Copy link
Member Author

Simple script to bump the Go Driver version:

package main

import (
	"bufio"
	"fmt"
	"os"
	"path"
)

const (
	versionFile      = "version/version.go"
)

func main() {
	repoDir, err := os.Getwd()
	versionFilePath := path.Join(repoDir, versionFile)
	readFile, err := os.Open(versionFilePath)

	if err != nil {
		fmt.Println(err)
	}
	fileScanner := bufio.NewScanner(readFile)
	fileScanner.Split(bufio.ScanLines)
	var fileLines []string

	for fileScanner.Scan() {
		fileLines = append(fileLines, fileScanner.Text())
	}

	readFile.Close()

	fileLines[len(fileLines)-1] = "var Driver = \"" + os.Args[1] + "\""

	writeFile, err := os.OpenFile(versionFilePath, os.O_WRONLY, 0644)
	if err != nil {
		fmt.Println(err)
	}
	for _, line := range fileLines {
		fmt.Fprintln(writeFile, line)
	}

	writeFile.Close()
}

@blink1073
Copy link
Member Author

Fixed by #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant