Skip to content

Commit

Permalink
Merge pull request #144 from lidofinance/feature/si-1463-add-pre-publish
Browse files Browse the repository at this point in the history
[Build] add pre publish
  • Loading branch information
DiRaiks authored Jul 23, 2024
2 parents 3980660 + b4bb5f3 commit 1a7ac9d
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ permissions:
id-token: write # to enable use of OIDC for npm provenance

jobs:
pre-publish:
if: github.ref == 'refs/heads/develop'
uses: ./.github/workflows/publish-dry-run.yml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish:
needs: pre-publish
runs-on: ubuntu-latest
environment: development
# restricts job to develop branch
Expand Down Expand Up @@ -44,7 +50,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Alpha
run: yarn multi-semantic-release --deps.bump=override --deps.release=patch --sequential-init
run: yarn multi-semantic-release
env:
NPM_CONFIG_PROVENANCE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/publish-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Dry Run
on:
workflow_dispatch:
workflow_call:
secrets:
NPM_TOKEN:
description: 'NPM token'
required: true

jobs:
publish-dry-run:
runs-on: ubuntu-latest
environment: development
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'

- name: Install dependencies
run: yarn --immutable

- name: Build
run: yarn build:packages

- name: Dry run Publish
run: yarn multi-semantic-release --dry-run --silent | grep -E '#|###|\*' > dry_run_output.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Write results to summary
run: |
if [ -s dry_run_output.txt ]; then
echo "# Packages to be published:" >> $GITHUB_STEP_SUMMARY
cat dry_run_output.txt >> $GITHUB_STEP_SUMMARY
else
echo "Nothing will be published" >> $GITHUB_STEP_SUMMARY
fi
7 changes: 6 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ permissions:
id-token: write # to enable use of OIDC for npm provenance

jobs:
pre-publish:
uses: ./.github/workflows/publish-dry-run.yml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish:
needs: pre-publish
runs-on: ubuntu-latest
environment: production
steps:
Expand Down Expand Up @@ -44,7 +49,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish
run: yarn multi-semantic-release --deps.bump=override --deps.release=patch --sequential-init
run: yarn multi-semantic-release
env:
NPM_CONFIG_PROVENANCE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@
}
]
},
"multi-release": {
"sequentialInit": true,
"deps": {
"bump": "override",
"release": "patch"
}
},
"packageManager": "[email protected]",
"engines": {
"node": ">=20"
Expand Down
5 changes: 5 additions & 0 deletions packages/sdk/src/stake/stake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,15 @@ export class LidoSDKStake extends LidoSDKModule {
): Promise<PopulatedTransaction> {
const { referralAddress, value, account } = await this.parseProps(props);
const data = this.stakeEthEncodeData({ referralAddress });
const gas = await this.submitGasLimit(value, referralAddress, {
account,
chain: this.core.chain,
});
const address = await this.contractAddressStETH();
return {
to: address,
from: account.address,
gas,
value,
data,
};
Expand Down

0 comments on commit 1a7ac9d

Please sign in to comment.