chore: import upstream snapshot with attribution
CI / Check and lint (push) Failing after 1s
Lint / Lint (ubuntu-latest) (push) Failing after 1s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:22:32 +08:00
commit 39dbe3a57d
1131 changed files with 272709 additions and 0 deletions
@@ -0,0 +1,60 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Build Binary For Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-goreleaser:
if: ${{ github.repository_owner == 'apache' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.18.1
- name: Node Build
run: make install-ui-packages ui
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Install GoReleaser
run: go install github.com/goreleaser/goreleaser/v2@latest
- name: Run GoReleaser
run: |
"$(go env GOPATH)/bin/goreleaser" release --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: answer
path: ./dist/*
@@ -0,0 +1,63 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Build Latest Docker Image For Release
on:
push:
tags:
- v2.*
- v1.*
- v0.*
- "!v*-RC*"
# pull_request:
# branches: [ "main" ]
jobs:
build:
if: ${{ github.repository_owner == 'apache' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Set up Docker Buildx
run: |
docker buildx create --name answer-builder --driver docker-container --use
docker buildx inspect --bootstrap
- name: Login to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username "${{ secrets.DOCKERHUB_USER }}" --password-stdin
- name: Build and push
run: |
BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
docker buildx build \
--file ./Dockerfile \
--platform linux/amd64,linux/arm64 \
--push \
--tag apache/answer:latest \
--label org.opencontainers.image.created="${BUILD_DATE}" \
--label org.opencontainers.image.revision="${GITHUB_SHA}" \
--label org.opencontainers.image.source="https://github.com/${GITHUB_REPOSITORY}" \
--label org.opencontainers.image.version="${GITHUB_REF_NAME#v}" \
.
@@ -0,0 +1,61 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Manual Build Docker Image For Release
on:
workflow_dispatch:
inputs:
tag_name:
type: string
required: true
description: 'DockerHub img tag name'
jobs:
build:
if: ${{ github.repository_owner == 'apache' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Set up Docker Buildx
run: |
docker buildx create --name answer-builder --driver docker-container --use
docker buildx inspect --bootstrap
- name: Login to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username "${{ secrets.DOCKERHUB_USER }}" --password-stdin
- name: Build and push
run: |
BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
docker buildx build \
--file ./Dockerfile \
--platform linux/amd64,linux/arm64 \
--push \
--tag "apache/answer:${{ inputs.tag_name }}" \
--label org.opencontainers.image.created="${BUILD_DATE}" \
--label org.opencontainers.image.revision="${GITHUB_SHA}" \
--label org.opencontainers.image.source="https://github.com/${GITHUB_REPOSITORY}" \
--label org.opencontainers.image.version="${{ inputs.tag_name }}" \
.
@@ -0,0 +1,64 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Build Docker Image For Release
on:
push:
tags:
- v2.*
- v1.*
- v0.*
# pull_request:
# branches: [ "main" ]
jobs:
build:
if: ${{ github.repository_owner == 'apache' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Set up Docker Buildx
run: |
docker buildx create --name answer-builder --driver docker-container --use
docker buildx inspect --bootstrap
- name: Login to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username "${{ secrets.DOCKERHUB_USER }}" --password-stdin
- name: Build and push
env:
IMAGE_TAG: ${{ github.ref_name }}
run: |
BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
docker buildx build \
--file ./Dockerfile \
--platform linux/amd64,linux/arm64 \
--push \
--tag "apache/answer:${IMAGE_TAG#v}" \
--label org.opencontainers.image.created="${BUILD_DATE}" \
--label org.opencontainers.image.revision="${GITHUB_SHA}" \
--label org.opencontainers.image.source="https://github.com/${GITHUB_REPOSITORY}" \
--label org.opencontainers.image.version="${IMAGE_TAG#v}" \
.
@@ -0,0 +1,52 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Build Docker Image For Test
on:
push:
branches: [ "test" ]
jobs:
build:
if: ${{ github.repository_owner == 'apache' }}
name: Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login --username "${{ secrets.DOCKERHUB_USER }}" --password-stdin
- name: Set up Docker Buildx
run: |
docker buildx create --name answer-builder --driver docker-container --use
docker buildx inspect --bootstrap
- name: Build and push
run: |
BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
docker buildx build \
--file ./Dockerfile \
--platform linux/amd64 \
--push \
--tag apache/answer:test \
--label org.opencontainers.image.created="${BUILD_DATE}" \
--label org.opencontainers.image.revision="${GITHUB_SHA}" \
--label org.opencontainers.image.source="https://github.com/${GITHUB_REPOSITORY}" \
.
+46
View File
@@ -0,0 +1,46 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
# Concurrency strategy:
# github.workflow: distinguish this workflow from others
# github.event_name: distinguish `push` event from `pull_request` event
# github.event.number: set to the number of the pull request if `pull_request` event
# github.run_id: otherwise, it's a `push` or `schedule` event, only cancel if we rerun the workflow
#
# Reference:
# https://docs.github.com/en/actions/using-jobs/using-concurrency
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true
jobs:
check:
name: Check and lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Check license header
uses: korandoru/hawkeye@v3
+62
View File
@@ -0,0 +1,62 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Lint
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Lint (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache: true
- name: Run go mod tidy
run: go mod tidy
- name: Run golangci-lint
run: make lint
- name: Check for uncommitted changes
shell: bash
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Uncommitted changes detected"
git status
git diff
exit 1
fi