diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67d67b3..406116f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: knights-ecomm-fe CI -on: +on: push: pull_request: @@ -38,3 +38,53 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} + release: + if: github.ref == 'refs/heads/ft-release-config' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Bump Version + id: bump_version + run: | + NEW_VERSION=$(npm version minor --no-git-tag-version) + echo "New version is $NEW_VERSION" + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + - name: Zip dist folder + run: zip -r dist.zip ./dist + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.NEW_VERSION }} + release_name: Release ${{ env.NEW_VERSION }} + draft: false + prerelease: false + + - 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: ./dist + asset_name: dist.zip + asset_content_type: application/zip diff --git a/package.json b/package.json index 4733f74..932b6d8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "knights-ecomm-fe", "private": true, - "version": "0.0.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite",