Skip to content

Commit

Permalink
refactor ci
Browse files Browse the repository at this point in the history
  • Loading branch information
antoooks committed Feb 3, 2024
1 parent e5eb6f9 commit ef69eb9
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 16 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/release-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
36 changes: 22 additions & 14 deletions .github/workflows/release-cmd-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
18 changes: 18 additions & 0 deletions .github/workflows/release-kustomize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 5 additions & 0 deletions .github/workflows/release-kyaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ef69eb9

Please sign in to comment.