更新 .gitea/workflows/demo.yaml
自动流水线示例 / build (push) Successful in 1m51s Details
自动流水线示例 / deploy (push) Successful in 17s Details
自动流水线示例 / 检查 (push) Has been skipped Details
自动流水线示例 / 制品上传 (ubuntu-latest, c) (push) Has been skipped Details
自动流水线示例 / 制品上传 (ubuntu-latest, a) (push) Has been skipped Details
自动流水线示例 / 制品上传 (ubuntu-latest, b) (push) Has been skipped Details

发布生产
This commit is contained in:
xiehaijun 2025-07-27 10:16:55 +00:00
parent 29902e0036
commit eaadae8e70
1 changed files with 37 additions and 5 deletions

View File

@ -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"
- 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 }}'