这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/tagging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- closed
- reopened
- synchronize

jobs:
modified-version-files:
runs-on: ubuntu-latest
Expand All @@ -26,16 +25,17 @@ jobs:
files: |
resources/*/VERSION
services/*/VERSION

tag-modules:
name: Create Git tag for modules with new versions
runs-on: ubuntu-latest
needs: [ modified-version-files ]
permissions:
contents: write
pull-requests: write
strategy:
matrix:
files: ${{ fromJSON(needs.modified-version-files.outputs.matrix) }}
file: ${{ fromJSON(needs.modified-version-files.outputs.matrix) }}
max-parallel: 2
fail-fast: false
steps:
Expand All @@ -50,7 +50,7 @@ jobs:

try {

const filename = '${{ matrix.files }}';
const filename = '${{ matrix.file }}';
core.info(`Processing file "${filename}".`);

const components = filename.split('/');
Expand All @@ -70,29 +70,33 @@ jobs:
core.setOutput('module-type', moduleType);
core.setOutput('tag', tag);
core.setOutput('version', version);

} catch (err) {
core.setFailed(`Action failed with error ${err}`);
}

# TODO: Check for existing tag
- name: Create release
id: create-release
uses: actions/github-script@v7
if: github.event.pull_request.merged == true
with:
script: |
const sourceUrl = `git::ssh://git@github.com/${{ github.repository }}//${{ steps.parse-version-file.outputs.module-directory }}?ref=${{ steps.parse-version-file.outputs.tag }}`
const name = '${{ steps.parse-version-file.outputs.module-name }} ${{ steps.parse-version-file.outputs.version }}'
const body = `
Version ${{ steps.parse-version-file.outputs.version }} of ${{ steps.parse-version-file.outputs.module-type }} module [${{ steps.parse-version-file.outputs.module-name }}](${{ steps.parse-version-file.outputs.module-directory }}).

To use this version of the module, set the \`source\` argument of the module call to \`${sourceUrl}\`.
To use this version of the module, set the \`source\` argument of the module call to the following value.
\`${sourceUrl}\`.

This release was generated for #${{ github.event.number }}'.
This release was generated for pull request #${{ github.event.number }}.
`
github.rest.repos.createRelease({
body: body,
name: '${{ steps.parse-version-file.outputs.module-name }} ${{ steps.parse-version-file.outputs.version }}',
name: name,
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ steps.parse-version-file.outputs.tag }}',
target_commitish: '${{ github.sha }}'
});

2 changes: 1 addition & 1 deletion resources/module-b/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.1.0
Loading