Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Ruck <[email protected]>
  • Loading branch information
Manuel Ruck committed Oct 17, 2023
1 parent ed07e93 commit d4dd912
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 62 deletions.
139 changes: 77 additions & 62 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
13 changes: 13 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]@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

0 comments on commit d4dd912

Please sign in to comment.