Skip to content

Commit

Permalink
fix: publishing workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <sam@elide.ventures>
  • Loading branch information
sgammon committed Mar 19, 2024
1 parent 479b6da commit 12474bc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ jobs:
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
persist-credentials: false
submodules: true
- name: "Setup: Node"
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
Expand All @@ -125,20 +124,20 @@ jobs:
echo "Release assets:"
ls -la packages/*/*.tgz
file packages/*/*.tgz
du -h file packages/*/*.tgz
du -h packages/*/*.tgz
echo ""
sha256sum packages/*/*.tgz > ./packages/${{ inputs.package }}/pkg-hashes.txt
echo "Hashes:"
cat ./packages/${{ inputs.package }}/pkg-hashes.txt
echo ""
cat ./packages/${{ inputs.package }}/pkg-hashes.txt | base64 -w0 ./packages/${{ inputs.package }}/pkg-hashes-encoded.txt
cat ./packages/${{ inputs.package }}/pkg-hashes.txt | base64 -w0 > ./packages/${{ inputs.package }}/pkg-hashes-encoded.txt
echo "Encoded Hashes:"
cat ./packages/${{ inputs.package }}/pkg-hashes-encoded.txt
echo ""
echo "hashes=$(cat /tmp/pkg-hashes-encoded.txt)" >> "$GITHUB_OUTPUT"
echo "hashes=$(cat ./packages/${{ inputs.package }}/pkg-hashes-encoded.txt)" >> "$GITHUB_OUTPUT"
- name: "Artifact: Packages"
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
Expand Down
52 changes: 45 additions & 7 deletions .github/workflows/ci.publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ permissions:
contents: read

jobs:
publish-npm:
name: "Publish to NPM (${{ matrix.package }})"
publish-npm-java:
name: "Publish to NPM"
uses: ./.github/workflows/ci.publish-package.yml
secrets:
PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
Expand All @@ -86,12 +86,50 @@ jobs:
id-token: write
contents: write
packages: write
strategy:
fail-fast: false
matrix:
package: ["java", "gradle", "maven"]
with:
package: ${{ matrix.package }}
package: java
dry-run: ${{ inputs.dry-run }}
registry: ${{ inputs.registry }}
release: ${{ inputs.release }}
tag: ${{ inputs.tag }}
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.prerelease }}
release-name: ${{ inputs.release-name }}
release-latest: ${{ inputs.release-latest }}

publish-npm-gradle:
name: "Publish to NPM"
uses: ./.github/workflows/ci.publish-package.yml
secrets:
PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
permissions:
actions: read
id-token: write
contents: write
packages: write
with:
package: gradle
dry-run: ${{ inputs.dry-run }}
registry: ${{ inputs.registry }}
release: ${{ inputs.release }}
tag: ${{ inputs.tag }}
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.prerelease }}
release-name: ${{ inputs.release-name }}
release-latest: ${{ inputs.release-latest }}

publish-npm-maven:
name: "Publish to NPM"
uses: ./.github/workflows/ci.publish-package.yml
secrets:
PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
permissions:
actions: read
id-token: write
contents: write
packages: write
with:
package: maven
dry-run: ${{ inputs.dry-run }}
registry: ${{ inputs.registry }}
release: ${{ inputs.release }}
Expand Down

0 comments on commit 12474bc

Please sign in to comment.