Skip to content

Commit

Permalink
Update workflows. (#179)
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
xuezhaojun authored Mar 7, 2024
1 parent 503b71a commit 7491951
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 29 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/go-postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ env:
# Common versions
GO_VERSION: '1.21'
GO_REQUIRED_MIN_VERSION: ''
defaults:
run:
working-directory: go/src/open-cluster-management.io/cluster-proxy

jobs:
images:
Expand All @@ -24,10 +21,9 @@ jobs:
arch: [ amd64, arm64 ]
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/cluster-proxy
- name: install Go
uses: actions/setup-go@v2
with:
Expand All @@ -51,10 +47,9 @@ jobs:
needs: [ images ]
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/cluster-proxy
- name: create
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login quay.io --username ${{ secrets.DOCKER_USER }} --password-stdin
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/go-presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v2
with:
Expand All @@ -34,15 +34,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Linelint
uses: fernandrone/[email protected]
verify:
name: verify
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v2
with:
Expand All @@ -54,7 +54,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v2
with:
Expand All @@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v2
with:
Expand All @@ -88,7 +88,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v2
with:
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@ env:
GITHUB_REF: ${{ github.ref }}
CHART_NAME: 'cluster-proxy'

defaults:
run:
working-directory: go/src/open-cluster-management.io/cluster-proxy

jobs:
env:
name: prepare release env
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/cluster-proxy
- name: get release version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
Expand All @@ -48,10 +43,9 @@ jobs:
arch: [ amd64, arm64 ]
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/cluster-proxy
- name: install Go
uses: actions/setup-go@v2
with:
Expand All @@ -75,10 +69,9 @@ jobs:
needs: [ env, images ]
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/cluster-proxy
- name: create
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login quay.io --username ${{ secrets.DOCKER_USER }} --password-stdin
Expand All @@ -100,10 +93,9 @@ jobs:
needs: [ env, image-manifest ]
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/cluster-proxy
- name: setup helm
uses: azure/setup-helm@v1
- name: chart package
Expand All @@ -112,12 +104,20 @@ jobs:
pushd release
helm package ../charts/${{ env.CHART_NAME }}/
popd
- name: generate changelog
run: |
echo "# Cluster Proxy ${{ needs.env.outputs.RELEASE_VERSION }}" > /home/runner/work/changelog.txt
- name: publish release
uses: ncipollo/release-action@v1
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.RELEASE_VERSION }}
artifacts: "go/src/open-cluster-management.io/cluster-proxy/release/*.tgz"
token: ${{ secrets.GITHUB_TOKEN }}
body_path: /home/runner/work/changelog.txt
files: |
release/*.tgz
draft: true
prerelease: false
generate_release_notes: true
- name: submit charts to OCM chart repo
uses: actions/github-script@v6
with:
Expand Down

0 comments on commit 7491951

Please sign in to comment.