重命名项目并补充插件与安全整改文档
This commit is contained in:
1 parent
a6049bf052
commit
e91a64136b
131 files changed
+1306
-771
No files matched your search
@@ -1,70 +0,0 @@
|
||||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> ${GITHUB_ENV}
|
||||
echo "${GITHUB_REF/refs\/tags\//}"
|
||||
echo "${GITHUB_REF#refs/*/}"
|
||||
echo "${GITHUB_REF}"
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: set lower case repository name
|
||||
run: |
|
||||
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
|
||||
env:
|
||||
REPOSITORY: '${{ github.repository }}'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Build FE
|
||||
run: |
|
||||
echo "$(git show -s --format=%H)"
|
||||
echo "GITHASH=$(git show -s --format=%H)" >> ${GITHUB_ENV}
|
||||
make build_fe
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v2.1.0
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
build-args: |
|
||||
VERSION=${{ env.VERSION }}
|
||||
GITHASH=${{ env.GITHASH }}
|
||||
context: .
|
||||
file: ./DockerfileGithubAction
|
||||
platforms: |
|
||||
linux/386
|
||||
linux/amd64
|
||||
linux/arm/v7
|
||||
linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:${{ env.VERSION }}
|
||||
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:latest
|
||||
@@ -1,68 +0,0 @@
|
||||
name: Docker Image CI Pre
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [ prereleased ]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: |
|
||||
echo "VERSION=pre${GITHUB_REF/refs\/tags\//}" >> ${GITHUB_ENV}
|
||||
echo "${GITHUB_REF/refs\/tags\//}"
|
||||
echo "${GITHUB_REF#refs/*/}"
|
||||
echo "${GITHUB_REF}"
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: set lower case repository name
|
||||
run: |
|
||||
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
|
||||
env:
|
||||
REPOSITORY: '${{ github.repository }}'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Build FE
|
||||
run: |
|
||||
echo "GITHASH=$(git show -s --format=%H)" >> ${GITHUB_ENV}
|
||||
make build_fe
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v2.1.0
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
build-args: |
|
||||
VERSION=${{ env.VERSION }}
|
||||
GITHASH=${{ env.GITHASH }}
|
||||
context: .
|
||||
file: ./DockerfileGithubAction
|
||||
platforms: |
|
||||
linux/386
|
||||
linux/amd64
|
||||
linux/arm/v7
|
||||
linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.REPOSITORY_LC }}:${{ env.VERSION }}
|
||||
@@ -37,14 +37,14 @@ jobs:
|
||||
check-latest: true
|
||||
- name: Gen output name
|
||||
run: |
|
||||
echo "FILENAME=pmail_${{ matrix.goos }}_${{ matrix.goarch }}" >> ${GITHUB_ENV}
|
||||
echo "FILENAME=smail_${{ matrix.goos }}_${{ matrix.goarch }}" >> ${GITHUB_ENV}
|
||||
echo "WCFILENAME=wechat_push_${{ matrix.goos }}_${{ matrix.goarch }}" >> ${GITHUB_ENV}
|
||||
echo "SPAMBLOCKFILENAME=spam_block_${{ matrix.goos }}_${{ matrix.goarch }}" >> ${GITHUB_ENV}
|
||||
echo "ZIPNAME=${{ matrix.goos }}_${{ matrix.goarch }}" >> ${GITHUB_ENV}
|
||||
- name: Rename Windows File
|
||||
if: matrix.goos == 'windows'
|
||||
run: |
|
||||
echo "FILENAME=pmail_${{ matrix.goos }}_${{ matrix.goarch }}.exe" >> ${GITHUB_ENV}
|
||||
echo "FILENAME=smail_${{ matrix.goos }}_${{ matrix.goarch }}.exe" >> ${GITHUB_ENV}
|
||||
echo "WCFILENAME=wechat_push_${{ matrix.goos }}_${{ matrix.goarch }}.exe" >> ${GITHUB_ENV}
|
||||
echo "SPAMBLOCKFILENAME=spam_block_${{ matrix.goos }}_${{ matrix.goarch }}.exe" >> ${GITHUB_ENV}
|
||||
- name: FE Build
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
name: PR - Docker unit test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
types: [opened, reopened, synchronize, edited]
|
||||
# Please, always create a pull request instead of push to master.
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: docker-test-${{ github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Docker tests
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
image: mysql
|
||||
env:
|
||||
MYSQL_DATABASE: pmail
|
||||
MYSQL_ROOT_PASSWORD: githubTest
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
postgres:
|
||||
image: postgres
|
||||
env:
|
||||
POSTGRESQL_PASSWORD: githubTest
|
||||
container:
|
||||
image: golang
|
||||
env:
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
TRIGGERING_ACTOR: ${{ github.triggering_actor }}
|
||||
SOURCE_BRANCH: ${{ github.ref_name }}
|
||||
COMMIT: ${{ github.workflow_sha }}
|
||||
EVENT: ${{ github.event_name}}
|
||||
steps:
|
||||
- name: Setup Node.js environment
|
||||
run: apt update && apt install -y nodejs npm
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Pull Request Labeler
|
||||
if: ${{ failure() }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh pr edit ${{ github.event.pull_request.number }} --add-label "Auto: Test Failed"
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install --global yarn
|
||||
|
||||
- name: FE build
|
||||
run: make build_fe
|
||||
|
||||
- name: Run Test Mysql
|
||||
run: make test_mysql
|
||||
|
||||
- name: Run Test
|
||||
run: make test
|
||||
|
||||
# - name: Run postgres
|
||||
# run: make test_postgres
|
||||
|
||||
Reference in new issue
Block a user