Skip to content

Commit d2da085

Browse files
committed
Fix workflows
1 parent c573ddd commit d2da085

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/build-release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@ jobs:
2424
- name: Setup problem matchers for PHP
2525
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
2626

27+
# Store the version, stripping any v-prefix
28+
- name: Write release version
29+
run: |
30+
TAG=${{ github.ref_name }}
31+
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
32+
2733
- uses: actions/checkout@v3
2834

2935
- name: Validate composer.json and composer.lock
3036
run: composer validate
3137

3238
- name: Set version in composer.json
33-
run: composer config version "${{ github.ref_name }}"
39+
run: composer config version "$VERSION"
3440

3541
- name: Install Composer dependencies
3642
run: composer install --no-progress --no-dev --prefer-dist --optimize-autoloader
@@ -46,16 +52,16 @@ jobs:
4652
- name: Build tarball
4753
run: |
4854
cd ..
49-
cp -R simplesamlphp "simplesamlphp-${{ github.ref_name }}"
50-
tar --owner 0 --group 0 -cvzf "/tmp/simplesamlphp-${{ github.ref_name }}.tar.gz" \
51-
"simplesamlphp-${{ github.ref_name }}"
55+
cp -R simplesamlphp "simplesamlphp-$VERSION"
56+
tar --owner 0 --group 0 -cvzf "/tmp/simplesamlphp-$VERSION.tar.gz" \
57+
"simplesamlphp-$VERSION"
5258
5359
- name: Save tarball
5460
uses: actions/upload-artifact@v3
5561
with:
5662
name: release
57-
path: "/tmp/simplesamlphp-${{ github.ref_name }}.tar.gz"
63+
path: "/tmp/simplesamlphp-$VERSION.tar.gz"
5864
retention-days: 1
5965

6066
- name: Calculate SHA checksum
61-
run: sha256sum "/tmp/simplesamlphp-${{ github.ref_name }}.tar.gz"
67+
run: sha256sum "/tmp/simplesamlphp-$VERSION.tar.gz"

.github/workflows/php.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ jobs:
5353

5454
- uses: actions/checkout@v3
5555

56+
- name: Get composer cache directory
57+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
58+
5659
- name: Cache composer dependencies
5760
uses: actions/cache@v3
5861
with:
@@ -111,6 +114,9 @@ jobs:
111114

112115
- uses: actions/checkout@v3
113116

117+
- name: Get composer cache directory
118+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
119+
114120
- name: Cache composer dependencies
115121
uses: actions/cache@v3
116122
with:

0 commit comments

Comments
 (0)