From d4dd9124173f208aedb9bc32a0ad2a4c2cd4e568 Mon Sep 17 00:00:00 2001 From: Manuel Ruck Date: Tue, 17 Oct 2023 19:13:15 +0200 Subject: [PATCH] test Signed-off-by: Manuel Ruck --- .github/workflows/release.yaml | 139 ++++++++++++++++++--------------- .github/workflows/test.yaml | 13 +++ 2 files changed, 90 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7c4c5b1bc..9d7c4c63d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -77,6 +77,19 @@ jobs: - run: echo "package=${{ matrix.package }}" + - name: Get pnpm store directory + id: pnpm-store + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-store.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: get directory for package id: get-directory run: | @@ -114,70 +127,72 @@ jobs: echo "$changelog" echo "changelog=$changelog" >> $GITHUB_OUTPUT - echo "{${{ matrix.package }} v$changelog}" >> $GITHUB_STEP_SUMMARY - working-directory: ${{ steps.get-directory.outputs.directory }} - env: - MATRIX_PACKAGE: ${{ matrix.package }} - - - name: Determine next version number - if: inputs.releaseVersion == 'auto' - run: | - nextVersion=`pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run | sed -n '/^---$/,/^---$/p' | grep -P -o '(\d+\.)(\d+\.)(\d)' | head -n 1` - echo "$nextVersion" - echo "NEXT_VERSION=$nextVersion" >> $GITHUB_ENV - working-directory: ${{ steps.get-directory.outputs.directory }} - env: - MATRIX_PACKAGE: ${{ matrix.package }} - - - name: Manually next version number - if: inputs.releaseVersion != 'auto' - run: | - echo "NEXT_VERSION=${{ inputs.releaseVersion }}" >> $GITHUB_ENV - echo "$NEXT_VERSION" - - - name: bump version - DRY RUN - if: inputs.dryRun == true - run: | - if ( ${{ inputs.releaseVersion == 'auto' }} ); then - pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run - else - pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' --dry-run - fi - working-directory: ${{ steps.get-directory.outputs.directory }} - env: - MATRIX_PACKAGE: ${{ matrix.package }} - - - name: bump version - AUTOMATIC - if: inputs.dryRun == false && inputs.releaseVersion == 'auto' - run: pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v - working-directory: ${{ steps.get-directory.outputs.directory }} - env: - MATRIX_PACKAGE: ${{ matrix.package }} + # echo "$changelog" >> $GITHUB_STEP_SUMMARY - - name: bump version - MANUAL VERSION NO. - if: inputs.dryRun == false && inputs.releaseVersion != 'auto' - run: pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' + # echo "{${{ matrix.package }} v$changelog}" >> $GITHUB_STEP_SUMMARY working-directory: ${{ steps.get-directory.outputs.directory }} env: MATRIX_PACKAGE: ${{ matrix.package }} - - name: Publish tag # only possible on default branch - if: inputs.dryRun == false - run: | - if ( ${{ contains(github.ref, github.event.repository.default_branch) }} ); then - git push --follow-tags origin ${{ github.event.repository.default_branch }} - else - exit 1 - fi - - - name: Publish GitHub release - uses: ncipollo/release-action@v1 - if: inputs.dryRun == false - env: - GITHUB_TOKEN: ${{ secrets.PAT }} # # use PAT to being able to push to protected branch later on - with: - tag: $NEXT_VERSION - name: $NEXT_VERSION - prerelease: true - body: | - ${{ steps.get_changelog.outputs.changelog }} + # - name: Determine next version number + # if: inputs.releaseVersion == 'auto' + # run: | + # nextVersion=`pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run | sed -n '/^---$/,/^---$/p' | grep -P -o '(\d+\.)(\d+\.)(\d)' | head -n 1` + # echo "$nextVersion" + # echo "NEXT_VERSION=$nextVersion" >> $GITHUB_ENV + # working-directory: ${{ steps.get-directory.outputs.directory }} + # env: + # MATRIX_PACKAGE: ${{ matrix.package }} + + # - name: Manually next version number + # if: inputs.releaseVersion != 'auto' + # run: | + # echo "NEXT_VERSION=${{ inputs.releaseVersion }}" >> $GITHUB_ENV + # echo "$NEXT_VERSION" + + # - name: bump version - DRY RUN + # if: inputs.dryRun == true + # run: | + # if ( ${{ inputs.releaseVersion == 'auto' }} ); then + # pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run + # else + # pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' --dry-run + # fi + # working-directory: ${{ steps.get-directory.outputs.directory }} + # env: + # MATRIX_PACKAGE: ${{ matrix.package }} + + # - name: bump version - AUTOMATIC + # if: inputs.dryRun == false && inputs.releaseVersion == 'auto' + # run: pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v + # working-directory: ${{ steps.get-directory.outputs.directory }} + # env: + # MATRIX_PACKAGE: ${{ matrix.package }} + + # - name: bump version - MANUAL VERSION NO. + # if: inputs.dryRun == false && inputs.releaseVersion != 'auto' + # run: pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' + # working-directory: ${{ steps.get-directory.outputs.directory }} + # env: + # MATRIX_PACKAGE: ${{ matrix.package }} + + # - name: Publish tag # only possible on default branch + # if: inputs.dryRun == false + # run: | + # if ( ${{ contains(github.ref, github.event.repository.default_branch) }} ); then + # git push --follow-tags origin ${{ github.event.repository.default_branch }} + # else + # exit 1 + # fi + + # - name: Publish GitHub release + # uses: ncipollo/release-action@v1 + # if: inputs.dryRun == false + # env: + # GITHUB_TOKEN: ${{ secrets.PAT }} # # use PAT to being able to push to protected branch later on + # with: + # tag: $NEXT_VERSION + # name: $NEXT_VERSION + # prerelease: true + # body: | + # ${{ steps.get_changelog.outputs.changelog }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..e1e36e5ed --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,13 @@ +name: Test + +on: + push: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: | + markdown="###\n\n## [1.0.3](https://github.com/demokratie-live/democracy-development/compare/cleanup-push-queue@v1.0.1...cleanup-push-queue@v1.0.3) (2023-10-17) \\\n\n* 📦️ migrate yarn to pnpm ([#514](https://github.com/demokratie-live/democracy-development/issues/514)) ([e171b05](https://github.com/demokratie-live/democracy-development/commit/e171b05ac0b007e070c73e804f9322f61c95903b))\\\n###" + + echo $markdown >> $GITHUB_STEP_SUMMARY