fix: 修复地域的中英文对照问题. #11
Workflow file for this run
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
| # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Java CI with Maven | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build with Maven | |
| run: mvn -B package --file pom.xml | |
| - run: mkdir staging && cp target/*.jar staging | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Package | |
| path: staging | |
| # 设置 jobs Maven pom 版本环境变量 | |
| - name: Set Release version env variable | |
| run: | | |
| echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV | |
| # 上传文件并发布 Release | |
| - uses: "marvinpinto/action-automatic-releases@latest" | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| automatic_release_tag: "${{ env.RELEASE_VERSION }}" | |
| prerelease: false | |
| title: "Release ${{ env.RELEASE_VERSION }}" | |
| files: | | |
| staging/*.jar | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| images: zcunsoft/accesslog-processing-simple | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| # TODO: Use Secrets when Public | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| build-args: | | |
| "JAR_FILE=staging/accesslog-processing-simple-${{ env.RELEASE_VERSION }}.jar" | |
| - name: Set Docker image tag | |
| id: set-tag | |
| run: echo "::set-output name=tag::$(if [ $GITHUB_REF == 'refs/heads/main' ]; then echo latest; else echo ${GITHUB_REF#refs/heads/}; fi)" | |
| - name: Login to Aliyun Docker Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| # TODO: Use Secrets when Public | |
| registry: ${{ secrets.ALIYUN_REGISTRY }} | |
| username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }} | |
| password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }} | |
| - name: Push image to Aliyun Docker Registry | |
| run: | | |
| docker buildx imagetools create \ | |
| --tag ${{ secrets.ALIYUN_REGISTRY }}/clklog/accesslog-processing-simple:latest \ | |
| zcunsoft/accesslog-processing-simple:${{ github.ref_name }} |