diff --git a/.github/workflows/release-api.yml b/.github/workflows/release-api.yml index cb062fad32..ba487ae53c 100644 --- a/.github/workflows/release-api.yml +++ b/.github/workflows/release-api.yml @@ -57,11 +57,26 @@ jobs: make install-local-tools - name: Pin kyaml, cmd/config run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" + git remote add upstream "https://x-access-token:${GITHUB_TOKEN}@github.com/antoooks/kustomize.git" + git remote -v + + # Pin dependencies: kyaml, cmd/config gorepomod pin kyaml --local --doIt gorepomod pin cmd/config --local --doIt - name: Build api run: | make build-kustomize-api + - name: Commit pinned dependencies + run: | + + # Commit pinned dependencies and handle no commit + git add --all + git commit -m "pin kyaml, cmd/config" || true + git push release: name: Release runs-on: ubuntu-latest @@ -78,7 +93,22 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work - - name: Release kyaml + cache-dependency-path: "**/*.sum" + - name: Pin kyaml, cmd/config + run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" + git remote add upstream "https://x-access-token:${GITHUB_TOKEN}@github.com/antoooks/kustomize.git" + git remote -v + + # Pin dependencies: kyaml, cmd/config + gorepomod pin kyaml --local --doIt + gorepomod pin cmd/config --local --doIt + - name: Release api run: | + + # Release api make install-local-tools - gorepomod release kyaml ${{ inputs.release_type }} --local --doIt + gorepomod release api ${{ inputs.release_type }} --local --doIt diff --git a/.github/workflows/release-cmd-config.yml b/.github/workflows/release-cmd-config.yml index a2cc586e12..1dd2c2c0a0 100644 --- a/.github/workflows/release-cmd-config.yml +++ b/.github/workflows/release-cmd-config.yml @@ -32,9 +32,12 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work + cache-dependency-path: "**/*.sum" - name: Unit test id: unit_test run: | + + # Run unit test echo "Executing unit test" go install github.com/jstemmer/go-junit-report@latest make test-unit-all | go-junit-report -set-exit-code > report.xml @@ -56,17 +59,31 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work + cache-dependency-path: "**/*.sum" - name: Install local tools run: | make install-local-tools - name: Pin kyaml run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" git remote add upstream "https://x-access-token:${GITHUB_TOKEN}@github.com/antoooks/kustomize.git" - git remote -v + git remote -v + + # Pin dependencies: kyaml gorepomod pin kyaml --local --doIt - name: Build test run: | make build-kustomize-api + - name: Commit pinned dependencies + run: | + + # Commit pinned dependencies and handle no commit + git add --all + git commit -m "pin kyaml, cmd/config" || true + git push release: name: Release runs-on: ubuntu-latest @@ -85,19 +102,10 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work - - name: Install local tools - run: | - make install-local-tools - - name: Pin kyaml - run: | - git config --global user.email "development@email.com" - git config --global user.name "Development" - git remote add upstream "https://x-access-token:${GITHUB_TOKEN}@github.com/antoooks/kustomize.git" - git remote -v - gorepomod pin kyaml --local --doIt - git add --all - git commit -m "pin kyaml" || true - git push + cache-dependency-path: "**/*.sum" - name: Release cmd/config run: | + + # Release cmd/config + make install-local-tools gorepomod release cmd/config ${{ inputs.release_type }} --local --doIt diff --git a/.github/workflows/release-kustomize.yml b/.github/workflows/release-kustomize.yml index 7d5e7fb54f..f639bc8f27 100644 --- a/.github/workflows/release-kustomize.yml +++ b/.github/workflows/release-kustomize.yml @@ -53,12 +53,27 @@ jobs: make install-local-tools - name: Pin kyaml, cmd/config, and api run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" + git remote add upstream "https://x-access-token:${GITHUB_TOKEN}@github.com/antoooks/kustomize.git" + git remote -v + + # Pin dependencies: kyaml, cmd/config, api gorepomod pin kyaml --local --doIt gorepomod pin cmd/config --local --doIt gorepomod pin api --local --doIt - name: Build test run: | make build-kustomize-api + - name: Commit pinned dependencies + run: | + + # Commit pinned dependencies and handle no commit + git add --all + git commit -m "pin kyaml, cmd/config, api" || true + git push release: name: Release runs-on: ubuntu-latest @@ -75,7 +90,10 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work + cache-dependency-path: "**/*.sum" - name: Release kyaml run: | + + # Release kustomize make install-local-tools gorepomod release kustomize ${{ inputs.release_type }} --local --doIt diff --git a/.github/workflows/release-kyaml.yml b/.github/workflows/release-kyaml.yml index 747544b1a0..5e9911a401 100644 --- a/.github/workflows/release-kyaml.yml +++ b/.github/workflows/release-kyaml.yml @@ -32,6 +32,7 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work + cache-dependency-path: "**/*.sum" - name: Unit test id: unit_test run: | @@ -58,6 +59,7 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work + cache-dependency-path: "**/*.sum" - name: Build test run: | make build-kustomize-api @@ -77,8 +79,11 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.work + cache-dependency-path: "**/*.sum" - name: Release kyaml run: | + + # Release kyaml git config --global user.email "development@email.com" git config --global user.name "Development" make install-tools