-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test actions Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * fix: docker images Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>
- Loading branch information
Showing
7 changed files
with
238 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,12 @@ jobs: | |
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Setup Golang with cache | ||
uses: magnetikonline/action-golang-cache@v3 | ||
with: | ||
|
@@ -51,6 +57,15 @@ jobs: | |
uses: docker/[email protected] | ||
with: | ||
images: openim/openim-chat | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
|
@@ -62,6 +77,7 @@ jobs: | |
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
@@ -107,6 +123,7 @@ jobs: | |
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta3.outputs.tags }} | ||
labels: ${{ steps.meta3.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,43 @@ permissions: | |
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --force --tags | ||
|
||
- name: setup-snapcraft | ||
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715 | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft | ||
mkdir -p $HOME/.cache/snapcraft/download | ||
mkdir -p $HOME/.cache/snapcraft/stage-packages | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: stable | ||
|
||
- name: set action env cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./_output/dist/*.deb | ||
./_output/dist/*.rpm | ||
./_output/dist/*.apk | ||
key: ${{ github.ref }} | ||
|
||
- uses: sigstore/[email protected] | ||
- uses: anchore/sbom-action/[email protected] | ||
- uses: crazy-max/ghaction-upx@v2 | ||
with: | ||
install-only: true | ||
- uses: cachix/install-nix-action@v22 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
# More assembly might be required: Docker logins, GPG, etc. It all depends | ||
# on your needs. | ||
- name: Set up QEMU | ||
|
@@ -31,25 +60,32 @@ jobs: | |
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Log in to GitHub Container Registry | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Log in to AliYun Docker Hub | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: registry.cn-hangzhou.aliyuncs.com | ||
username: ${{ secrets.ALIREGISTRY_USERNAME }} | ||
password: ${{ secrets.ALIREGISTRY_TOKEN }} | ||
|
||
# - name: snapcraft-login | ||
# if: startsWith(github.ref, 'refs/tags/v') | ||
# run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_TOKEN }}") | ||
|
||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro': | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: ci2 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
openim/openim-chat:latest | ||
openim/openim-chat:1.0.0 | ||
ghcr.io/openimsdk/openim-chat:latest | ||
ghcr.io/openimsdk/openim-chat:1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: ci | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: openim/openim-chat:latest |
Oops, something went wrong.