Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
nohaapav committed Oct 17, 2024
1 parent 43aabeb commit 7f8ff97
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
49 changes: 26 additions & 23 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,42 @@ jobs:
PR: ${{ github.event.pull_request.number }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}

- name: 🛠️ Build SDK
run: npm run build

- name: 🚀 Publish snapshot
run: npm run changeset -- publish --no-git-tag --snapshot --tag beta

- name: 😎 Upload release plan
uses: actions/upload-artifact@v4
with:
name: release-plan
path: release-plan.json

hydration-ui-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: 😎 Download release plan
uses: actions/download-artifact@v4
with:
name: release-plan
path: release-plan.json
- name: ⏳ Check for updates
shell: bash
run: |
if [ "$(cat ../releasePlan.json | jq '. | length')" -eq 0 ]; then
if [ "$(cat release-plan.json | jq '. | length')" -eq 0 ]; then
echo "No update available :("
else
echo "UPDATE_AVAILABLE=true" >> $GITHUB_ENV
echo "Release plan:"
cat ../releasePlan.json
cat release-plan.json
fi
- name: 🛠️ Build SDK
if: env.UPDATE_AVAILABLE == 'true'
run: npm run build

- name: 🚀 Publish snapshot
if: false
run: npm run changeset -- publish --no-git-tag --snapshot --tag beta

- name: 🤘 Checkout hydration-ui repository
if: env.UPDATE_AVAILABLE == 'true'
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: 'galacticcouncil/hydration-ui'
token: ${{ secrets.TARGET_REPO_PAT }}
path: 'hydration-ui'

- name: 🧩 Bump dependecies in hydration-ui repository
if: env.UPDATE_AVAILABLE == 'true'
run: |
ls -la
cd ..
ls -la
cp ./sdk/scripts/changeset-update-ext.mjs ./hydration-ui/changeset-update-ext.mjs
node ./hydration-ui/changeset-update-ext.mjs
cat ./hydration-ui/package.json
2 changes: 1 addition & 1 deletion scripts/changeset-snapshot.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const main = async () => {
});

const releasePlanJson = JSON.stringify(releasePlan, null, 2);
writeFileSync('../releasePlan.json', releasePlanJson);
writeFileSync('release-plan.json', releasePlanJson);
await applyReleasePlan(releasePlan, packages, releaseConfig, true);
};

Expand Down

0 comments on commit 7f8ff97

Please sign in to comment.