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

draft: 5449 add release automation #5520

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
148221c
add githuub workflow
antoooks Jan 6, 2024
65356f1
add --doIt flag
antoooks Jan 6, 2024
f1df812
make create-release.sh work with CI
antoooks Jan 28, 2024
716c1e4
add create release branch, trigger gh workflow, and release branch check
antoooks Jan 28, 2024
50ee2c4
fix script
antoooks Jan 28, 2024
86455ff
fix script
antoooks Jan 28, 2024
57ae17d
fix script
antoooks Jan 28, 2024
4800367
fix github workflow
antoooks Jan 28, 2024
46b10e4
fix kyaml gworkflow
antoooks Jan 29, 2024
614410c
fix workflow
antoooks Jan 29, 2024
817b380
add dependencies between jobs
antoooks Jan 29, 2024
c649a7d
add dind container
antoooks Jan 29, 2024
108ba53
add docker action
antoooks Jan 29, 2024
df2841d
add install podman action
antoooks Jan 29, 2024
638d0d5
remove e2e
antoooks Jan 30, 2024
baf0f1b
fix workflow
antoooks Jan 30, 2024
3d56c36
add --local flag
antoooks Jan 30, 2024
c6065d2
add permissions
antoooks Jan 30, 2024
a083475
add git config
antoooks Jan 30, 2024
1e0a374
add --local flag
antoooks Jan 31, 2024
b79ab01
add upstream
antoooks Jan 31, 2024
b5936b4
add slugification
antoooks Feb 3, 2024
c87af9d
add permission
antoooks Feb 3, 2024
7888acb
add permission
antoooks Feb 3, 2024
d9bbe32
add pinning
antoooks Feb 3, 2024
1109572
fix workflow
antoooks Feb 3, 2024
f6ce01d
fix workflow
antoooks Feb 3, 2024
55bdcbf
fix gorepomod release
antoooks Feb 3, 2024
e93dc44
fix gorepomod release
antoooks Feb 3, 2024
36b961c
fix gorepomod release
antoooks Feb 3, 2024
56406d3
fix gorepomod release
antoooks Feb 3, 2024
9007fe9
fix gorepomod release
antoooks Feb 3, 2024
d6c8d19
fix gorepomod release
antoooks Feb 3, 2024
1a376a0
fix release branch formatting
antoooks Feb 3, 2024
17c100b
fix release script
antoooks Feb 3, 2024
79525c2
refactor ci
antoooks Feb 3, 2024
b452df0
fix workflow
antoooks Feb 3, 2024
4091122
add determineNextVersion function
antoooks Feb 3, 2024
22927bd
fix workflow
antoooks Feb 3, 2024
a329f27
fix workflow
antoooks Feb 3, 2024
ee83295
create release branch without checking out
antoooks Feb 3, 2024
142ad62
fix release script
antoooks Feb 3, 2024
1092b6f
comment release branch creation
antoooks Feb 3, 2024
b5fb7ea
change releasing script parameter
antoooks Feb 3, 2024
228818c
change how create-release parameter works
antoooks Feb 3, 2024
dbdb34a
print tag
antoooks Feb 3, 2024
c9135dd
fix workflow
antoooks Feb 3, 2024
eb26eac
fix versioning
antoooks Feb 3, 2024
22dff95
fix workflow
antoooks Feb 4, 2024
5e4de6e
split build-kustomize-libarry from create-release
antoooks Feb 4, 2024
d3639f5
change version bump logic
antoooks Feb 4, 2024
711342d
fix logic
antoooks Feb 4, 2024
81ae1fb
fix tagging logic
antoooks Feb 4, 2024
4fb47b8
add testing, add GetCurrentVersionFromHead
antoooks Feb 4, 2024
ebe04d5
handle getting version from current release branch
antoooks Feb 4, 2024
dc8f34f
add deprecation notice
antoooks Feb 4, 2024
28e0f9e
fix workflow and update test step action version
antoooks Feb 4, 2024
04ebcba
fix build-kustomize-library
antoooks Feb 4, 2024
8d6a252
fix get latest tag
antoooks Feb 10, 2024
94e7a7b
update git workflow
antoooks Feb 12, 2024
c3d7a36
fix workflow
antoooks Feb 12, 2024
8fbf055
fix workflow
antoooks Feb 12, 2024
9a20d92
create release branch release-kustomize-v5.3.1
antoooks Feb 12, 2024
a44662c
fix workflow
antoooks Feb 12, 2024
fdb9381
fix workflow
antoooks Feb 12, 2024
a6bde58
fix workflow
antoooks Feb 12, 2024
7d1d462
remove hardcoded versions
antoooks Feb 12, 2024
0ed3b6e
improve persing to clean CRLF
antoooks Feb 19, 2024
9abde51
fix bugs when releasing
antoooks May 12, 2024
0c54819
fix semver bump bug
antoooks May 12, 2024
04cb22d
fix workflow
antoooks May 12, 2024
a9f1f64
fix bug
antoooks May 12, 2024
e4e34cc
fix bugs
antoooks May 12, 2024
2211bab
update release script
antoooks May 12, 2024
42f1305
add checkout depth
antoooks May 12, 2024
69fa868
fix releasing script
antoooks May 12, 2024
223b5b9
fix bug
antoooks May 12, 2024
6a3e524
fix version when pinning to avoid error
antoooks May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
132 changes: 132 additions & 0 deletions .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}"
134 changes: 134 additions & 0 deletions .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}"
131 changes: 131 additions & 0 deletions .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