Skip to content

Commit

Permalink
Pack the product before publishing
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
  • Loading branch information
gaiksaya committed Jan 23, 2024
1 parent 6203839 commit 8914386
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,24 @@ jobs:
run: |
echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT
echo "version=$(cat package.json | jq .version | tr -d "\"")" >> $GITHUB_OUTPUT
- uses: trstringer/manual-approval@v1
with:
secret: ${{ github.TOKEN }}
approvers: ${{ steps.get_data.outputs.approvers }}
minimum-approvals: 2
issue-title: 'Release opensearch-cluster-cdk : ${{ steps.get_data.outputs.version }}'
issue-body: "Please approve or deny the release of opensearch-cluster-cdk. **VERSION**: ${{ steps.get_data.outputs.version }} **TAG**: ${{ github.ref_name }} **COMMIT**: ${{ github.sha }}"
exclude-workflow-initiator-as-approver: true
- name: Release
# - uses: trstringer/manual-approval@v1
# with:
# secret: ${{ github.TOKEN }}
# approvers: ${{ steps.get_data.outputs.approvers }}
# minimum-approvals: 2
# issue-title: 'Release opensearch-cluster-cdk : ${{ steps.get_data.outputs.version }}'
# issue-body: "Please approve or deny the release of opensearch-cluster-cdk. **VERSION**: ${{ steps.get_data.outputs.version }} **TAG**: ${{ github.ref_name }} **COMMIT**: ${{ github.sha }}"
# exclude-workflow-initiator-as-approver: true
- name: Build and package
run: |
npm pack
filename=`ls | grep opensearch-project-opensearch-cluster-cdk`
mkdir opensearch-cluster-cdk && mv $filename opensearch-cluster-cdk/opensearch-cluster-cdk.tar.gz
tar -cvf artifacts.tar.gz opensearch-cluster-cdk
- name: Draft a release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
generate_release_notes: true
files: |
artifacts.tar.gz
5 changes: 4 additions & 1 deletion jenkins/release.jenkinsFile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ standardReleasePipelineWithGenericTrigger(
tokenIdCredential: 'jenkins-opensearch-cluster-cdk-generic-webhook-token',
causeString: 'A tag was cut on opensearch-project/opensearch-cluster-cdk repository causing this workflow to run',
publishRelease: true) {
publishToNpm(publicationType: 'github')
publishToNpm(
publicationType: 'artifact',
artifactPath: "${WORKSPACE}/opensearch-cluster-cdk/opensearch-cluster-cdk.tar.gz"
)
}

0 comments on commit 8914386

Please sign in to comment.