2023-04-27 12:08:41 +08:00
|
|
|
name: release-nightly
|
2023-02-26 12:16:38 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-06-28 15:48:10 +08:00
|
|
|
branches: [main]
|
2024-04-10 15:06:08 +08:00
|
|
|
tags:
|
2024-06-28 15:48:10 +08:00
|
|
|
- "*"
|
2023-02-26 12:16:38 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
goreleaser:
|
2023-03-01 12:32:00 +08:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-26 12:16:38 +08:00
|
|
|
steps:
|
2024-03-14 21:27:47 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-26 12:20:47 +08:00
|
|
|
with:
|
2023-04-19 17:46:52 +08:00
|
|
|
fetch-depth: 0 # all history for all branches and tags
|
2024-03-14 21:27:47 +08:00
|
|
|
- uses: actions/setup-go@v5
|
2023-04-19 17:46:52 +08:00
|
|
|
with:
|
2024-06-28 15:48:10 +08:00
|
|
|
go-version-file: "go.mod"
|
2023-02-26 13:34:26 +08:00
|
|
|
- name: goreleaser
|
2024-03-14 21:27:47 +08:00
|
|
|
uses: goreleaser/goreleaser-action@v5
|
2023-02-26 12:16:38 +08:00
|
|
|
with:
|
2023-08-10 09:45:25 +08:00
|
|
|
distribution: goreleaser-pro
|
|
|
|
version: latest
|
|
|
|
args: release --nightly
|
2023-02-26 12:16:38 +08:00
|
|
|
env:
|
|
|
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
2023-02-26 13:00:36 +08:00
|
|
|
AWS_REGION: ${{ secrets.AWS_REGION }}
|
2023-02-27 15:30:35 +08:00
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
|
2023-02-26 13:00:36 +08:00
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
2023-02-27 14:42:57 +08:00
|
|
|
S3_REGION: ${{ secrets.AWS_REGION }}
|
|
|
|
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
|
2024-06-28 15:48:10 +08:00
|
|
|
GORELEASER_FORCE_TOKEN: "gitea"
|
2024-03-27 18:51:45 +08:00
|
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-04-27 12:08:41 +08:00
|
|
|
release-image:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: catthehacker/ubuntu:act-latest
|
|
|
|
env:
|
|
|
|
DOCKER_ORG: gitea
|
|
|
|
DOCKER_LATEST: nightly
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-03-14 21:27:47 +08:00
|
|
|
uses: actions/checkout@v4
|
2023-04-27 12:08:41 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # all history for all branches and tags
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
2023-11-24 11:05:00 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-04-27 12:08:41 +08:00
|
|
|
|
|
|
|
- name: Set up Docker BuildX
|
2023-11-24 11:05:07 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-04-27 12:08:41 +08:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2023-11-24 11:05:22 +08:00
|
|
|
uses: docker/login-action@v3
|
2023-04-27 12:08:41 +08:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Get Meta
|
|
|
|
id: meta
|
|
|
|
run: |
|
|
|
|
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
2024-06-28 15:48:10 +08:00
|
|
|
echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT
|
2023-04-27 12:08:41 +08:00
|
|
|
|
|
|
|
- name: Build and push
|
2023-11-24 11:05:28 +08:00
|
|
|
uses: docker/build-push-action@v5
|
2023-04-27 12:08:41 +08:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
platforms: |
|
|
|
|
linux/amd64
|
|
|
|
linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|
|
|
|
|
2023-06-15 13:27:35 +08:00
|
|
|
- name: Build and push dind-rootless
|
2023-11-24 11:05:28 +08:00
|
|
|
uses: docker/build-push-action@v5
|
2023-06-15 13:27:35 +08:00
|
|
|
env:
|
2024-06-28 15:48:10 +08:00
|
|
|
ACTIONS_RUNTIME_TOKEN: "" # See https://gitea.com/gitea/act_runner/issues/119
|
2023-06-15 13:27:35 +08:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile.rootless
|
|
|
|
platforms: |
|
|
|
|
linux/amd64
|
|
|
|
linux/arm64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}-dind-rootless
|