【发布时间】:2020-12-10 09:35:05
【问题描述】:
我正在尝试为所有通过检查的提交添加标签。我从一个包含测试的模板开始。
一切都按预期运行,但是,当我检查标签时,它没有显示任何已添加。
这是我完整的build.yml:
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: build
on:
pull_request:
branches: ['*']
push:
branches: ['master']
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
1.8, # Minimum supported by Minecraft
11, # Current Java LTS
15 # Latest version
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: bump version and push tag
id: tag_version
if: ${{ github.event_name == 'push' && runner.os == 'Linux' && matrix.java == '11' }}
uses: mathieudutour/github-tag-action@v5.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
create_annotated_tag: true
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
这是我运行的操作:https://github.com/cloewen8/Corntopia/actions
在过去的一个小时里,我一直在努力让它发挥作用。我尝试在结帐后将“bump version and push tag”任务从末尾移动到右侧,添加和删除id,更改为github_token定义,使标签注释,尝试任务的先前版本,使用标签在一个版本中(说 new_tag 没有定义),甚至完全按照为任务提供的示例。
我做错了吗?还有什么我应该尝试的吗?
【问题讨论】:
标签: github-actions