hotfix: enhance schedule handling with dynamic time slots and improed rendering #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release Extension | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - main | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: github.event.pull_request.merged == true | |
| outputs: | |
| TAG_NAME: ${{ steps.version.outputs.TAG_NAME }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies with Yarn | |
| run: yarn install --frozen-lockfile | |
| - name: Build the extension | |
| run: yarn build | |
| - name: Get extension version | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "TAG_NAME=v$VERSION" >> $GITHUB_OUTPUT | |
| - name: Zip dist folder | |
| run: zip -r kmitl-x-${{ steps.version.outputs.TAG_NAME }}.zip dist/ | |
| - name: Upload extension zip as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kmitl-x-${{ steps.version.outputs.TAG_NAME }}.zip | |
| path: kmitl-x-${{ steps.version.outputs.TAG_NAME }}.zip | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.TAG_NAME }} | |
| name: Release ${{ steps.version.outputs.TAG_NAME }} | |
| files: kmitl-x-${{ steps.version.outputs.TAG_NAME }}.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-chrome: | |
| name: Publish to Chrome Web Store | |
| runs-on: ubuntu-latest | |
| needs: build-and-release | |
| if: github.event.pull_request.merged == true | |
| steps: | |
| - name: Download extension artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: kmitl-x-${{ needs.build-and-release.outputs.TAG_NAME }}.zip | |
| - name: Publish to Chrome Web Store | |
| uses: mnao305/chrome-extension-upload@v5.0.0 | |
| with: | |
| file-path: kmitl-x-${{ needs.build-and-release.outputs.TAG_NAME }}.zip | |
| extension-id: "lnhfadikffnjjhmoimkeinbbhcnkkcln" | |
| client-id: ${{ secrets.CLIENT_ID }} | |
| client-secret: ${{ secrets.CLIENT_SECRET }} | |
| refresh-token: ${{ secrets.REFRESH_TOKEN }} | |
| publish: true | |