Skip to content

Commit

Permalink
chore: improve github action to allow manual ref input
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Sep 28, 2024
1 parent 4920269 commit 4e98f67
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
- 'beta/v**'
- 'release/v**'
- 'test/v**'
workflow_dispatch:
inputs:
tag:
description: 'Tag to build from'
required: true

jobs:
build:
Expand All @@ -26,23 +31,26 @@ jobs:
github-token: ${{ secrets.RELEASE_NOTES_TOKEN }}
result-encoding: string
script: |
return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[1];
const ref = process.env.GITHUB_REF || github.event.inputs.tag || '';
return ref.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[1];
- name: Get file version from tag
id: get_version
uses: actions/github-script@v7
with:
github-token: ${{ secrets.RELEASE_NOTES_TOKEN }}
result-encoding: string
script: |
return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[4];
const ref = process.env.GITHUB_REF || github.event.inputs.tag || '';
return ref.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[4];
- name: Get main mc version from tag
id: get_mc_version
uses: actions/github-script@v7
with:
github-token: ${{ secrets.RELEASE_NOTES_TOKEN }}
result-encoding: string
script: |
return '${{ github.ref }}'.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[3];
const ref = process.env.GITHUB_REF || github.event.inputs.tag || '';
return ref.match(/refs\/tags\/(.*)\/v((.*)-(.*))/)[3];
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
Expand Down

0 comments on commit 4e98f67

Please sign in to comment.