diff --git a/.github/workflows/release-api.yml b/.github/workflows/release-api.yml new file mode 100644 index 0000000000..0cf7b216da --- /dev/null +++ b/.github/workflows/release-api.yml @@ -0,0 +1,132 @@ +name: release-api + +on: + workflow_dispatch: + inputs: + release_type: + type: choice + description: release type (major, minor, or patch). + options: + - major + - minor + - patch + required: true + default: 'patch' + release_branch: + type: string + description: release branch name "release-api-v*" + required: true + default: 'master' + +jobs: + pre-build: + name: Pre-build + runs-on: ubuntu-latest + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 10 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + 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 + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: | + ./report.xml + if: always() + build: + name: Build + runs-on: ubuntu-latest + needs: pre-build + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + - name: Install local tools + run: | + 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 v0.17.0 --local --doIt + gorepomod pin cmd/config v0.14.0 --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 + needs: build + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + permissions: + contents: write + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + cache-dependency-path: "**/*.sum" + - name: Release api + run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" + + # Release api + make install-local-tools + gorepomod release api ${{ inputs.release_type }} --local --doIt + - name: Create release changelog + run: | + + # Create release draft + changelog_file=$(mktemp) + currentTag=$(git describe --tags) + ./releasing/compile-changelog.sh "api" "${currentTag}" "${changelog_file}" + + # Create github releases + gh release create "${currentTag}" \ + --title "${currentTag}" \ + --draft \ + --notes-file "${changelog_file}" diff --git a/.github/workflows/release-cmd-config.yml b/.github/workflows/release-cmd-config.yml new file mode 100644 index 0000000000..64200013f5 --- /dev/null +++ b/.github/workflows/release-cmd-config.yml @@ -0,0 +1,134 @@ +name: release-cmd-config + +on: + workflow_dispatch: + inputs: + release_type: + type: choice + description: release type (major, minor, or patch). + options: + - major + - minor + - patch + required: true + default: 'patch' + release_branch: + type: string + description: release branch name "release-cmd/config-v*" + required: true + default: 'master' + +jobs: + pre-build: + name: Pre-build + runs-on: ubuntu-latest + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 10 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + 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 + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: | + ./report.xml + if: always() + build: + name: Build + runs-on: ubuntu-latest + needs: pre-build + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + permissions: + contents: write + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + 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 + + # Pin dependencies: kyaml + gorepomod pin kyaml v0.17.0 --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" || true + git push + release: + name: Release + runs-on: ubuntu-latest + needs: build + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + permissions: + contents: write + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + cache-dependency-path: "**/*.sum" + - name: Release cmd/config + run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" + + # Release cmd/config + make install-local-tools + gorepomod release cmd/config ${{ inputs.release_type }} --local --doIt + - name: Create release changelog + run: | + + # Create release draft + changelog_file=$(mktemp) + currentTag=$(git describe --tags) + ./releasing/compile-changelog.sh "cmd/config" "${currentTag}" "${changelog_file}" + + # Create github releases + gh release create "${currentTag}" \ + --title "${currentTag}" \ + --draft \ + --notes-file "${changelog_file}" diff --git a/.github/workflows/release-kustomize.yml b/.github/workflows/release-kustomize.yml new file mode 100644 index 0000000000..d858a889b6 --- /dev/null +++ b/.github/workflows/release-kustomize.yml @@ -0,0 +1,131 @@ +name: release-kustomize + +on: + workflow_dispatch: + inputs: + release_type: + type: choice + description: release type (major, minor, or patch). + options: + - major + - minor + - patch + required: true + default: 'patch' + release_branch: + type: string + description: release branch name "release-kustomize-v*" + required: true + default: 'master' + +jobs: + pre-build: + name: Pre-build + runs-on: ubuntu-latest + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 10 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + 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 + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + cache-dependency-path: "**/*.sum" + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: | + ./report.xml + if: always() + build: + name: Build + runs-on: ubuntu-latest + needs: pre-build + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + - name: Install local tools + run: | + 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" + # TODO: change to kustomize token and url + 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 v0.17.0 --local --doIt + gorepomod pin cmd/config v0.14.0 --local --doIt + gorepomod pin api v0.17.1 --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 + needs: build + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + permissions: + contents: write + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + cache-dependency-path: "**/*.sum" + - name: Release kyaml + run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" + + # Release kustomize + make install-local-tools + gorepomod release kustomize ${{ inputs.release_type }} --local --doIt + - name: Build kustomize library and create release + run: | + + # Create release draft + ./releasing/build-kustomize-library.sh diff --git a/.github/workflows/release-kyaml.yml b/.github/workflows/release-kyaml.yml new file mode 100644 index 0000000000..5b63b68ada --- /dev/null +++ b/.github/workflows/release-kyaml.yml @@ -0,0 +1,112 @@ +name: release-kyaml + +on: + workflow_dispatch: + inputs: + release_type: + type: choice + description: release type (major, minor, or patch). + options: + - major + - minor + - patch + required: true + default: 'patch' + release_branch: + type: string + description: release branch name "release-kyaml-v*" + required: true + default: 'master' + +jobs: + pre-build: + name: Pre-build + runs-on: ubuntu-latest + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 10 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + 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 + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: | + ./report.xml + if: always() + build: + name: Build + needs: pre-build + runs-on: ubuntu-latest + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + cache-dependency-path: "**/*.sum" + - name: Build test + run: | + make build-kustomize-api + release: + name: Release + needs: build + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Fetch changes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.release_branch }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.work + cache-dependency-path: "**/*.sum" + - name: Release kyaml + run: | + + # Prepare git + git config --global user.email "development@kustomize.io" + git config --global user.name "Development" + git checkout ${{inputs.release_branch}} + + # Release kyaml + make install-tools + gorepomod release kyaml ${{ inputs.release_type }} --local --doIt + - name: Create release changelog + run: | + + # Create release draft + changelog_file=$(mktemp) + currentTag=$(git describe --tags) + ./releasing/compile-changelog.sh "kyaml" "${currentTag}" "${changelog_file}" + + # Create github releases + gh release create "${currentTag}" \ + --title "${currentTag}" \ + --draft \ + --notes-file "${changelog_file}" + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file