From eaadae8e70348c7dfaae14e4e16719f1411ad6cf Mon Sep 17 00:00:00 2001 From: xiehaijun Date: Sun, 27 Jul 2025 10:16:55 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/demo.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 发布生产 --- .gitea/workflows/demo.yaml | 42 +++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 55270ff..f36895c 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -105,6 +105,9 @@ jobs: run: | echo 'mvn clean install -DskipTests && mvn -B package --file pom.xml' mvn --version + - name: 列出工作目录列表 + run: | + ls ${{ gitea.workspace }} - name: 构建镜像并推送 run: | echo 'docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}"' @@ -136,13 +139,42 @@ jobs: whoami ls -al echo "I am $FOO" - - name: 列出工作目录列表 - run: | - ls ${{ gitea.workspace }} - run: echo "🍏 This job's status is ${{ job.status }}." - debug: + check: + name: 检查 needs: [build, deploy] runs-on: ubuntu-latest if: ${{ failure() }} steps: - - run: echo "Failed to build and deploy" \ No newline at end of file + - run: echo "Failed to build and deploy" + + upload: + name: 制品上传 + needs: check + strategy: + matrix: + os: [ubuntu-latest] + #os: [ubuntu-latest, windows-latest] + version: [a, b, c] + runs-on: ${{ matrix.os }} + steps: + - name: 生成制品 + run: ./some-script --version=${{ matrix.version }} > my-binary + - name: 安装上传制品插件 + uses: actions/upload-artifact@v4 + id: artifact-upload-step-id + with: + name: binary-${{ matrix.os }}-${{ matrix.version }} + path: my-binary + retention-days: 90 # 保留期必须介于 1 到 90 天(含)之间。 + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + compression-level: 9 # 6:默认压缩(与 GNU Gzip 相同) + #path: | + # path/output/bin/ + # path/output/test-results + # !path/**/*.tmp + - name: 输出制品相关信息 + run: | + echo 'Artifact ID is ${{ steps.artifact-upload-step-id.outputs.artifact-id }}' + echo 'Artifact URL is ${{ steps.artifact-upload-step-id.artifact-url }}' + echo 'Artifact SHA 256 is ${{ steps.artifact-upload-step-id.artifact-digest }}' \ No newline at end of file