diff --git a/.github/workflows/go-release.yml b/.github/workflows/go-release.yml index b563a7f89..32bce669a 100644 --- a/.github/workflows/go-release.yml +++ b/.github/workflows/go-release.yml @@ -72,8 +72,8 @@ jobs: - name: Get release directory name id: release-dir run: | - chmod +x ./scripts/go-release-automation.sh - RELEASE_DIR_NAME=$(./scripts/go-release-automation.sh get_release_dir_name "${{ github.event.inputs.project-name }}" "${{ github.event.inputs.version }}") + chmod +x ./submodules/MaterialProviders/scripts/go-release-automation.sh + RELEASE_DIR_NAME=$(./submodules/MaterialProviders/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 @@ -84,31 +84,10 @@ jobs: - name: Run Go release automation script run: | - chmod +x ./scripts/go-release-automation.sh - ./scripts/go-release-automation.sh run_release_script ${{ github.event.inputs.project-name }} ${{ github.event.inputs.version }} + chmod +x ./submodules/MaterialProviders/scripts/go-release-automation.sh + ./submodules/MaterialProviders/scripts/go-release-automation.sh run_release_script ${{ github.event.inputs.project-name }} ${{ github.event.inputs.version }} - - name: Create Pull Request - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: print diff between development and release directory run: | - PROJECT_NAME="${{ github.event.inputs.project-name }}" - VERSION="${{ github.event.inputs.version }}" - - # Get the release directory name using the sourced function - RELEASE_DIR_NAME="${{ steps.release-dir.outputs.releaseDirName }}" - - BRANCH_NAME="golang-release-staging-branch/$RELEASE_DIR_NAME/$VERSION" - DIFF_FILES=$(diff -qr $PROJECT_NAME/runtimes/go/ImplementationFromDafny-go releases/go/$RELEASE_DIR_NAME || true) - - # Create PR using GitHub CLI - gh pr create \ - --title "chore(go): Release $RELEASE_DIR_NAME Go module $VERSION" \ - --body "This PR was automatically created by the Go Release Automation workflow. It releases version $VERSION of the $RELEASE_DIR_NAME Go module. The diff between $PROJECT_NAME/runtimes/go/ImplementationFromDafny-go and releases/go/$RELEASE_DIR_NAME is below: - - $DIFF_FILES - " \ - --base main \ - --head "$BRANCH_NAME" \ - --label "golang" \ - --draft + echo $DIFF_FILES diff --git a/project.properties b/project.properties index 0de26ec02..39f9cb146 100644 --- a/project.properties +++ b/project.properties @@ -1,5 +1,5 @@ projectJavaVersion=3.9.0-SNAPSHOT -mplDependencyJavaVersion=1.11.0-SNAPSHOT +mplDependencyJavaVersion=1.11.1-SNAPSHOT dafnyVersion=4.9.0 dafnyVerifyVersion=4.9.1 dafnyRuntimeJavaVersion=4.9.0 diff --git a/scripts/go-release-automation.sh b/scripts/go-release-automation.sh deleted file mode 100644 index 4e105550f..000000000 --- a/scripts/go-release-automation.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash - -# Go Release Process Script -# Used for copying go files to release directory and make a commit - -set -e # Exit on error - -# Check if project name and version is provided -if [ $# -ne 3 ]; then - echo "Usage: 0ドル [version]" - echo "Example: 0ドル get_release_dir_name DynamoDbEncryption v0.1.0" - echo "Example: 0ドル run_release_script DynamoDbEncryption v0.1.0" - exit 1 -fi - -# Function to map project name to release directory name -get_release_dir_name() { - local project=1ドル - case "$project" in - "DynamoDbEncryption") echo "dynamodb-esdk" ;; - *) echo "Error: Unknown project name: $project">&2; return 1 ;; - esac -} - -run_release_script() { - PROJECT_NAME=1ドル - VERSION=2ドル - - echo "Starting Go release script for $PROJECT_NAME $VERSION" - - # Pull the latest smithy-dafny and libraries git submodules - echo " Pulling latest git submodules..." - git submodule update --init --recursive - - # Go to the project directory - echo " Navigating to $PROJECT_NAME..." - cd "$PROJECT_NAME" || { echo "Error: Project directory $PROJECT_NAME not found"; exit 1; } - - # Build using make commands - echo " Building project..." - make polymorph_dafny - make polymorph_go - make transpile_go - make test_go - - # Run Go tools in ImplementationFromDafny-go - echo " Running Go tools in ImplementationFromDafny-go..." - cd runtimes/go/ImplementationFromDafny-go || { echo "Error: ImplementationFromDafny-go directory not found"; exit 1; } - - find . -name "*shim.go" -type f -delete - echo "Removed all shim.go files" - - echo "Running goimports..." - goimports -w . - - echo "Running go get -u..." - go get -u - - echo "Running go mod tidy..." - go mod tidy - - echo "Running go build to check for errors..." - go build --gcflags="-e" ./... - - # Replacement directives are removed to get package from go pkg instead of local copy - echo "Removing all replace directives from go.mod..." - go mod edit -json | jq -r '.Replace[].Old.Path' | xargs -n1 go mod edit -dropreplace - - # Get the mapped release directory name - RELEASE_DIR_NAME=$(get_release_dir_name "$PROJECT_NAME") - - # Copy files to releases directory - echo " Copying files to releases/go/$RELEASE_DIR_NAME..." - - # Use rsync to copy files while excluding following ones: - # ImplementationFromDafny.go: This file is for devlopment. Users is expected use API(s) from `*/api_client.go` - # ImplementationFromDafny-go.dtr: This is the dafny translation record only needed for code generation - # go.sum: This files will be updated by go mod tidy - rsync -av --exclude="ImplementationFromDafny.go" --exclude="ImplementationFromDafny-go.dtr" --exclude="go.sum" ./ "$(git rev-parse --show-toplevel)/releases/go/$RELEASE_DIR_NAME/" - - # Run Go tools in releases directory - echo "Running Go tools in releases/go/$RELEASE_DIR_NAME..." - - cd "$(git rev-parse --show-toplevel)/releases/go/$RELEASE_DIR_NAME/" || { echo "Error: releases directory not found"; exit 1; } - - echo "Running goimports..." - goimports -w . - echo "Running go get -u..." - go get -u ./... - - echo "Running go mod tidy..." - go mod tidy - - echo "Running go build to check for errors..." - go build --gcflags="-e" ./... - - # Prepare for commit - echo "creating a branch..." - - git checkout -b "golang-release-staging-branch/$RELEASE_DIR_NAME/${VERSION}" - git add * - - git commit -m "Release $RELEASE_DIR_NAME Go module ${VERSION}" - git push origin "golang-release-staging-branch/$RELEASE_DIR_NAME/${VERSION}" -} - -"$@" \ No newline at end of file diff --git a/submodules/MaterialProviders b/submodules/MaterialProviders index ec013f6ba..952c42f1c 160000 --- a/submodules/MaterialProviders +++ b/submodules/MaterialProviders @@ -1 +1 @@ -Subproject commit ec013f6ba85d62ab41db48fec92baca85625e4b9 +Subproject commit 952c42f1c7cfad57cc9ea0115c2a0cb38164ead7

AltStyle によって変換されたページ (->オリジナル) /