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 b149294
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ 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 }}
GITHUB_ENV: ${{ env.GITHUB_ENV }}

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

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion 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 Down

0 comments on commit b149294

Please sign in to comment.