Skip to content

Commit

Permalink
Update publish-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
huseyindeniz authored Dec 22, 2024
1 parent 3fe0ea2 commit 7457ed7
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,66 @@ permissions:
pull-requests: write

jobs:
publish:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Build project
run: |
npm ci
npm run build
- name: Zip bundle
run: |
zip -r ./${{ github.sha }}.zip .
- name: Archive artifact
uses: actions/upload-artifact@v3
with:
name: zipped-bundle
path: ${{ github.sha }}.zip

publish:
runs-on: ubuntu-latest
needs: [build]
steps:

- name: Get version from package.json
id: get_version
run: |
VERSION=$(jq -r .version < package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: New release for commit ${{ github.sha }}. Release notes on the documentation site
draft: false
body: New release for commit ${{ github.sha }}.
draft: true
prerelease: true

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: zipped-bundle

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ github.sha }}.zip
asset_name: source_code_with_libraries.zip
asset_content_type: application/zip





0 comments on commit 7457ed7

Please sign in to comment.