-
Notifications
You must be signed in to change notification settings - Fork 29
chore(go): add Go release workflow #792
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
Changes from all commits
a33ef8d
a3303aa
34191df
8b1b50d
ba0278e
121bb63
a5de953
17f4391
dc8148c
2aa6b79
c286938
3d8b53a
bda38cc
5ce2fd5
a3283aa
5f61571
7acd6e8
cbc1fd8
2cd5321
dd2aba1
027cecd
5d2ab3b
2141441
1732e95
ca235ca
d2f6c56
1ef771c
e390acf
75441c7
c4494d3
bf92fdb
bf8c3fb
e276da2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: Go Release Automation | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| project-name: | ||
| description: "Project name (e.g., AwsEncryptionSDK)" | ||
| required: true | ||
| type: string | ||
| version: | ||
| description: "Version (e.g., v0.1.0)" | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| get-dafny-version: | ||
| permissions: {} | ||
| uses: ./.github/workflows/dafny_version.yaml | ||
|
|
||
| go-release: | ||
| needs: get-dafny-version | ||
| runs-on: macos-13 | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Support longpaths on Git checkout | ||
| run: | | ||
| git config --global core.longpaths true | ||
|
|
||
| - name: Configure AWS Credentials for Tests | ||
| uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| aws-region: us-west-2 | ||
| role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 | ||
| role-session-name: GoReleaseTest | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Update submodules | ||
| run: | | ||
| git submodule update --init --recursive | ||
|
|
||
| - name: Setup Dafny | ||
| uses: ./mpl/.github/actions/setup_dafny | ||
| with: | ||
| dafny-version: ${{ needs.get-dafny-version.outputs.version }} | ||
|
|
||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: "1.23" | ||
|
|
||
| - name: Install Go imports | ||
| run: | | ||
| go install golang.org/x/tools/cmd/goimports@latest | ||
|
|
||
| - name: Install Smithy-Dafny codegen dependencies | ||
| uses: ./.github/actions/install_smithy_dafny_codegen_dependencies | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config --global user.name "GitHub Actions" | ||
| git config --global user.email "actions@github.com" | ||
|
|
||
| - name: Get release directory name | ||
| id: release-dir | ||
| run: | | ||
| chmod +x mpl/scripts/go-release-automation.sh | ||
| RELEASE_DIR_NAME=$(mpl/scripts/go-release-automation.sh get_release_dir_name "${{ github.event.inputs.project-name }}" "${{ github.event.inputs.version }}") | ||
| echo "releaseDirName=$RELEASE_DIR_NAME" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Generate a changelog | ||
| uses: orhun/git-cliff-action@v4 | ||
| with: | ||
| config: releases/go/.git-cliff.toml | ||
| args: --bump -u --prepend releases/go/${{ steps.release-dir.outputs.releaseDirName }}/CHANGELOG.md | ||
|
|
||
| - name: Run Go release automation script | ||
| run: | | ||
| chmod +x mpl/scripts/go-release-automation.sh | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. q; why not make this an executable and check it in instead of having to change it-flight?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did think about it and it might be better.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. anyway this is a nit so I merged it. |
||
| mpl/scripts/go-release-automation.sh run_release_script ${{ github.event.inputs.project-name }} ${{ github.event.inputs.version }} | ||
|
|
||
| - name: print diff between development and release directory | ||
| run: | | ||
| RELEASE_DIR_NAME="${{ steps.release-dir.outputs.releaseDirName }}" | ||
| PROJECT_NAME="${{ github.event.inputs.project-name }}" | ||
| DIFF_FILES=$(diff -qr $PROJECT_NAME/runtimes/go/ImplementationFromDafny-go releases/go/$RELEASE_DIR_NAME || true) | ||
| echo $DIFF_FILES | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| [git] | ||
| tag_pattern = "^releases/go/encryption-sdk/v*" | ||
| filter_commits = true | ||
| commit_parsers = [ | ||
| { message = '^feat\((go|all languages)\)', group = "Features"}, | ||
| { message = '^fix\((go|all languages)\)', group = "Fixes"}, | ||
| { message = '^chore\((go|all languages)\)', group = "Maintenance"}, | ||
| { message = '^docs\((go|all languages)\)', group = "Maintenance"}, | ||
| { message = '^revert\((go|all languages)\)', group = "Fixes"}, | ||
| { message = '^style\((go|all languages)\)', group = "Miscellaneous"}, | ||
| { message = '^refactor\((go|all languages)\)', group = "Miscellaneous"}, | ||
| { message = '^perf\((go|all languages)\)', group = "Miscellaneous"}, | ||
| { message = '^test\((go|all languages)\)', group = "Miscellaneous"}, | ||
| ] | ||
| commit_preprocessors = [ | ||
| { pattern = '\(dafny\)', replace = '(all languages)'} | ||
| ] | ||
|
|
||
| [changelog] | ||
| header = "# Changelog\n\n" | ||
| trim = true |
Uh oh!
There was an error while loading. Please reload this page.