fix: 修复 MySQL 保留字 key 导致的 SQL 语法错误 #30
This file contains hidden or 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
| name: Build and Publish Docker Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v2 | |
| - name: Set VERSION | |
| run: | | |
| echo "VERSION=$(cat VERSION | tr -d '\n')" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| with: | |
| install: true | |
| use: true | |
| - name: Install QEMU for multi-platform builds | |
| uses: docker/setup-qemu-action@v2 | |
| with: | |
| platforms: all | |
| - name: Log in to Docker Hub | |
| 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: | |
| context: . | |
| platforms: linux/amd64,linux/arm/v7 | |
| push: true | |
| tags: | | |
| ${{ secrets.DOCKER_USERNAME }}/channel-monitor:latest | |
| ${{ secrets.DOCKER_USERNAME }}/channel-monitor:${{ env.VERSION }} | |
| - name: Setup Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: '^1.23.1' | |
| - name: Build Binary | |
| run: | | |
| sudo apt install upx -y | |
| bash build.sh | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.VERSION }} | |
| release_name: Release ${{ env.VERSION }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload Linux AMD64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./build/ChannelMonitor_linux_amd64 | |
| asset_name: ChannelMonitor_linux_amd64 | |
| asset_content_type: application/octet-stream | |
| - name: Upload Linux ARM64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./build/ChannelMonitor_linux_arm64 | |
| asset_name: ChannelMonitor_linux_arm64 | |
| asset_content_type: application/octet-stream | |
| - name: Upload Darwin ARM64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./build/ChannelMonitor_darwin_arm64 | |
| asset_name: ChannelMonitor_darwin_arm64 | |
| asset_content_type: application/octet-stream | |
| - name: Upload Darwin AMD64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./build/ChannelMonitor_darwin_amd64 | |
| asset_name: ChannelMonitor_darwin_amd64 | |
| asset_content_type: application/octet-stream | |
| - name: Upload Windows AMD64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./build/ChannelMonitor_windows_amd64.exe | |
| asset_name: ChannelMonitor_windows_amd64.exe | |
| asset_content_type: application/octet-stream | |
| - name: Upload Windows ARM64 Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./build/ChannelMonitor_windows_arm64.exe | |
| asset_name: ChannelMonitor_windows_arm64.exe | |
| asset_content_type: application/octet-stream |