diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index c9eb10ea3ab60d216ccb345c75a8048582a5007d..c039fff41bbeaa28f6d59f02561a05ab276bdf74 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -24,13 +24,19 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + # Store the version, stripping any v-prefix + - name: Write release version + run: | + TAG=${{ github.ref_name }} + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + - uses: actions/checkout@v3 - name: Validate composer.json and composer.lock run: composer validate - name: Set version in composer.json - run: composer config version "${{ github.ref_name }}" + run: composer config version "$VERSION" - name: Install Composer dependencies run: composer install --no-progress --no-dev --prefer-dist --optimize-autoloader @@ -46,16 +52,16 @@ jobs: - name: Build tarball run: | cd .. - cp -R simplesamlphp "simplesamlphp-${{ github.ref_name }}" - tar --owner 0 --group 0 -cvzf "/tmp/simplesamlphp-${{ github.ref_name }}.tar.gz" \ - "simplesamlphp-${{ github.ref_name }}" + cp -R simplesamlphp "simplesamlphp-$VERSION" + tar --owner 0 --group 0 -cvzf "/tmp/simplesamlphp-$VERSION.tar.gz" \ + "simplesamlphp-$VERSION" - name: Save tarball uses: actions/upload-artifact@v3 with: name: release - path: "/tmp/simplesamlphp-${{ github.ref_name }}.tar.gz" + path: "/tmp/simplesamlphp-$VERSION.tar.gz" retention-days: 1 - name: Calculate SHA checksum - run: sha256sum "/tmp/simplesamlphp-${{ github.ref_name }}.tar.gz" + run: sha256sum "/tmp/simplesamlphp-$VERSION.tar.gz" diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 008cb2a0c9f2f168bc8e09fc3932c297b217d22f..d654bb6df68861bd4583cd9324b71f304590dc29 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -53,6 +53,9 @@ jobs: - uses: actions/checkout@v3 + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" + - name: Cache composer dependencies uses: actions/cache@v3 with: @@ -111,6 +114,9 @@ jobs: - uses: actions/checkout@v3 + - name: Get composer cache directory + run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV" + - name: Cache composer dependencies uses: actions/cache@v3 with: