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

Refactor CICDs #2942

Merged
merged 50 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
945d872
Create deploy-docs.yml
mitch1024 May 31, 2024
22b087b
Update deploy-docs.yml
mitch1024 May 31, 2024
ac7720a
Update deploy-docs.yml
mitch1024 May 31, 2024
dbe14e4
Update deploy-docs.yml
mitch1024 Jun 3, 2024
707ca7d
Update deploy-docs.yml
mitch1024 Jun 3, 2024
7f96448
Update deploy-docs.yml
mitch1024 Jun 3, 2024
42a703b
Update deploy-docs.yml
mitch1024 Jun 3, 2024
2b9da50
Update deploy-docs.yml
mitch1024 Jun 3, 2024
d678487
Update deploy-docs.yml
mitch1024 Jun 3, 2024
6e952bf
Update deploy-docs.yml
mitch1024 Jun 3, 2024
df84248
Update deploy-docs.yml
mitch1024 Jun 3, 2024
a7ae36a
Update deploy-docs.yml
mitch1024 Jun 3, 2024
e2e5185
Update deploy-docs.yml
mitch1024 Jun 3, 2024
1eddb95
Update deploy-docs.yml
mitch1024 Jun 3, 2024
f6068d5
Update deploy-docs.yml
mitch1024 Jun 3, 2024
e1ccb67
Update deploy-docs.yml
mitch1024 Jun 3, 2024
85831fc
Update deploy-docs.yml
mitch1024 Jun 3, 2024
ee5eee2
Update deploy-docs.yml
mitch1024 Jun 3, 2024
462b5f4
Update deploy-docs.yml
mitch1024 Jun 3, 2024
ec074c5
Update deploy-docs.yml
mitch1024 Jun 3, 2024
247d052
Update Dockerfile
mitch1024 Jun 3, 2024
50548de
Update deploy-docs.yml
mitch1024 Jun 3, 2024
f707fa9
add deps
mitch-z Jun 3, 2024
0b9be15
Update deploy-docs.yml
mitch1024 Jun 4, 2024
ef2b361
Update deploy-docs.yml
mitch1024 Jun 4, 2024
e673938
Update deploy-docs.yml
mitch1024 Jun 4, 2024
d56e325
Update deploy-docs.yml
mitch1024 Jun 4, 2024
a5e14bc
Update deploy-docs.yml
mitch1024 Jun 4, 2024
59c3709
Update deploy-docs.yml
mitch1024 Jun 4, 2024
49232a8
Update deploy-docs.yml
mitch1024 Jun 4, 2024
674e5ad
Update Dockerfile
mitch1024 Jun 4, 2024
d16850c
Update Dockerfile
mitch1024 Jun 4, 2024
988f90f
Update and rename BuildAndPublish.yml to publish-docker-image.yml
mitch1024 Jun 4, 2024
883b172
Update and rename TestUnit.yml to run-unit-tests.yml
mitch1024 Jun 4, 2024
4e5e518
Update releases.yml
mitch1024 Jun 4, 2024
a3a07c7
Rename release-binary.yml to releases.yml
mitch1024 Jun 4, 2024
eb7179d
Update deploy-docs.yml
mitch1024 Jun 4, 2024
2dff75e
Update deploy-docs.yml
mitch1024 Jun 4, 2024
4919fa7
Update README.md
mitch1024 Jun 4, 2024
cb88e2e
add release notes
mitch-z Jun 4, 2024
e391c1f
Update releases.yml
mitch1024 Jun 4, 2024
05d8b55
remove windows binary support
mitch-z Jun 5, 2024
722cf2b
remove windows binary support
mitch-z Jun 5, 2024
cf4f59a
replace github.ref to GITHUB_REF_NAME
mitch-z Jun 5, 2024
0b65ce7
remove zip binaries step
mitch-z Jun 5, 2024
8f25fe1
remove test contents
mitch-z Jun 5, 2024
1f35ea1
Merge branch 'develop'
mitch-z Jun 5, 2024
2edc046
remove package-lock.json
mitch-z Jun 5, 2024
cc2bda5
upgrade actions
mitch-z Jun 5, 2024
e054531
upgrade actions
mitch-z Jun 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions .github/workflows/BuildAndPublish.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL"

on:
push:
branches: [ master, develop, documents, hotfix/*, release* ]
branches: [ master, develop, hotfix/*, release/* ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
Expand All @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
73 changes: 73 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build and Deploy Docs

on:
push:
branches: [ "master" ]
paths: [ "docs/**" ]

jobs:
setup-build-publish:
name: Setup, Build and Publish
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: 'docs/'
sparse-checkout-cone-mode: false

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
file: ./docs/Dockerfile
push: true
tags: irisnet/docs:${{ github.sha }}

deploy:
name: Deploy
runs-on: arc-runner-set
environment: production

permissions:
contents: 'read'
id-token: 'write'

steps:
- name: 'Set up Google Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
install_components: "gke-gcloud-auth-plugin"

- name: Set up Kubectl
uses: azure/setup-kubectl@v3
with:
version: 'v1.21.0'

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GKE_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENDITY_PROVIDER }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
token_format: 'access_token'

- name: Set up GKE credentials
uses: google-github-actions/get-gke-credentials@v2
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_REGION }}

- name: Deploy to GKE
run: |
gcloud container clusters get-credentials app --region ${{ secrets.GKE_REGION }} --project ${{ secrets.GKE_PROJECT }}
kubectl set image -n irisnet deployment/irisnet-docs frontend=irisnet/docs:${{ github.sha }}
kubectl rollout status -n irisnet deployment/irisnet-docs
30 changes: 30 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and Publish Docker Image
on:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5

jobs:
setup-build-publish:
name: Setup, Build and Publish
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
push: true
tags: irisnet/irishub:${{ github.ref == 'refs/tags/*' && github.ref || github.sha }}
62 changes: 0 additions & 62 deletions .github/workflows/release-binary.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
setup-build-publish:
name: Setup, Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout Codes
uses: actions/checkout@v4

- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: '^1.21.0' # The Go version to download (if necessary) and use.

- name: Build Binaries
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu
make build-all-binaries

- name: Publish Release
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE.md
files: |
build/iris-linux-amd64
build/iris-linux-arm64
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: TestUnit
name: Run Unit Tests
on: [pull_request]

jobs:
test-unit:
name: Test Units
# runs-on: self-hosted
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v1
- name: Setup go
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '^1.21' # The Go version to download (if necessary) and use.
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ build/
.out
docs/.vuepress/dist/
node_modules/
package.json
yarn.lock
dependency-graph.png
mytestnet
buf-stamp
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ endif
build-linux: check-evm-chain-id go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

build-all-binary: check-evm-chain-id go.sum
build-all-binaries: check-evm-chain-id go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build $(BUILD_FLAGS) -o build/iris-linux-amd64 ./cmd/iris
LEDGER_ENABLED=false GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc go build $(BUILD_FLAGS) -o build/iris-linux-arm64 ./cmd/iris
LEDGER_ENABLED=false GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build $(BUILD_FLAGS) -o build/iris-windows-amd64.exe ./cmd/iris

build-contract-tests-hooks:
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -251,4 +250,4 @@ start-rly:
kill-dev:
@echo "Killing nftd and removing previous data"
-@rm -rf ./data
-@killall nftd 2>/dev/null
-@killall nftd 2>/dev/null
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the content for release notes or detail the TODO.

Would you like assistance in drafting the initial release notes? If so, please provide some bullet points or features to include.

6 changes: 3 additions & 3 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM node:alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
COPY docs/package.json docs/yarn.lock ./
RUN yarn install
COPY . .
COPY docs/ .
RUN yarn run build

FROM nginx:alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/.vuepress/dist /usr/share/nginx/html/docs
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
1 change: 0 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
## About IRISnet

IRISnet (a.k.a IRIS Hub) is designed to be the foundation for the next generation distributed applications. Built with Cosmos-SDK, IRIS Hub enables cross-chain interoperability through a unified service model, while providing a variety of modules to support distributed business applications.

Loading
Loading