Skip to content

Commit

Permalink
Merge branch 'feature/refactor-dist-github-actions'
Browse files Browse the repository at this point in the history
  • Loading branch information
jelovirt committed Jan 4, 2024
2 parents 8e4f07e + 61df07a commit d584b69
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@ jobs:
cache: gradle
- name: Build with Gradle
run: ./gradlew dist
- name: Set variables
run: |
echo "CHKSUM=$(shasum -a 256 build/distributions/com.elovirta.pdf-*.zip | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
files: build/distributions/com.elovirta.pdf-*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
shasum: ${{ env.CHKSUM }}
registry:
needs: dist
runs-on: ubuntu-latest
steps:
- name: Set variables
run: |
echo "CHKSUM=$(shasum -a 256 build/distributions/com.elovirta.pdf-*.zip | cut -d ' ' -f 1)" >> $GITHUB_ENV
echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
echo "PLUGIN_NAME=com.elovirta.pdf" >> $GITHUB_ENV
- name: Check out registry
Expand All @@ -43,7 +51,7 @@ jobs:
cat ${{ env.PLUGIN_NAME }}.json \
| jq '.[length -1]' \
| jq --arg url "$URL" '. | .url|=$url' \
| jq --arg chksum "${{ env.CHKSUM }}" '. | .cksum|=$chksum' \
| jq --arg chksum "${{ needs.dist.outputs.shasum }}" '. | .cksum|=$chksum' \
| jq --arg vers "${{ env.VERSION }}" '. | .vers|=$vers' > buf.json
jq '. += [input]' ${{ env.PLUGIN_NAME }}.json buf.json \
| jq . > concat.json
Expand All @@ -61,4 +69,4 @@ jobs:
body: |
Add plug-in `${{ env.PLUGIN_NAME }}` version `${{ env.VERSION }}`.
* [Release notes](https://github.com/jelovirt/pdf-generator/releases/tag/${{ env.VERSION }})
* [Release notes](https://github.com/jelovirt/pdf-generator/releases/tag/${{ env.VERSION }})

0 comments on commit d584b69

Please sign in to comment.