Skip to content

Commit

Permalink
Use redmine version envs in build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hidakatsuya committed Jul 11, 2024
1 parent 3ac92bc commit 295ebe9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ jobs:
database: ${{ matrix.redmine-database }}
ruby-version: ${{ matrix.ruby-version }}

- name: Define Redmine version environment variables
run: ./scripts/set-version-envs.sh
env:
REDMINE_DIR: ${{ env.REDMINE_SRC }}

- name: Install a plugin for testing
run: |
cp -R ../.github/hello_world plugins/
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ runs:
- name: Define Redmine version environment variables
run: ./scripts/set-version-envs.sh
shell: bash
env:
REDMINE_DIR: ${{ inputs.path }}

- name: Install dependencies
run: |
Expand Down
10 changes: 5 additions & 5 deletions scripts/set-version-envs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

file=$REDMINE_SRC/lib/redmine/version.rb
file=$REDMINE_DIR/lib/redmine/version.rb

version_major=$(grep -oE 'MAJOR *= *[0-9]+' $file | awk 'NR==1 {print $3}')
version_minor=$(grep -oE 'MINOR *= *[0-9]+' $file | awk 'NR==1 {print $3}')
Expand All @@ -9,7 +9,7 @@ version_branch=$(grep -oE 'BRANCH *= *'\''.+?' $file | awk -F"'" 'NR==1 {print $

echo "Redmine Version: $version_major.$version_minor.$version_tiny.$version_branch"

echo "VERSION_MAJOR=$redmine_major" >> $GITHUB_ENV
echo "VERSION_MINOR=$redmine_minor" >> $GITHUB_ENV
echo "VERSION_TINY=$redmine_tiny" >> $GITHUB_ENV
echo "VERSION_BRANCH=$redmine_branch" >> $GITHUB_ENV
echo "VERSION_MAJOR=$version_major" >> $GITHUB_ENV
echo "VERSION_MINOR=$version_minor" >> $GITHUB_ENV
echo "VERSION_TINY=$version_tiny" >> $GITHUB_ENV
echo "VERSION_BRANCH=$version_branch" >> $GITHUB_ENV

0 comments on commit 295ebe9

Please sign in to comment.