feat: Localize extension name and description for English and Chinese… #4
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: huntly extension release workflow | |
| on: | |
| push: | |
| tags: [ 'ext/v*.*.*' ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| create-release: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_id: ${{ steps.create-release.outputs.id }} | |
| release_upload_url: ${{ steps.create-release.outputs.upload_url }} | |
| version: ${{ steps.get_version.outputs.version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Get version from tag | |
| id: get_version | |
| run: | | |
| # Extract version from tag (ext/v1.0.0 -> 1.0.0) | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG_NAME#ext/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | |
| - name: Get tag message | |
| id: tag | |
| run: | | |
| git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| echo "message<<EOF" >> $GITHUB_OUTPUT | |
| echo "$(git tag -l --format='%(contents)' $TAG_NAME)" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| id: create-release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| draft: true | |
| name: Extension ${{ steps.get_version.outputs.version }} | |
| tag: ${{ steps.get_version.outputs.tag_name }} | |
| body: "${{ steps.tag.outputs.message }}" | |
| build-upload: | |
| runs-on: ubuntu-latest | |
| needs: create-release | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "20.10.0" | |
| cache: "yarn" | |
| cache-dependency-path: "app/extension/yarn.lock" | |
| - name: Setup yarn | |
| run: npm install -g yarn --version 1.22.19 | |
| - name: Install extension dependencies | |
| run: | | |
| cd app/extension | |
| yarn install | |
| - name: Create extension bundle (Chrome) | |
| run: | | |
| cd app/extension | |
| yarn build | |
| env: | |
| CI: false | |
| EXTENSION_VERSION: ${{ needs.create-release.outputs.version }} | |
| - name: Package release files | |
| run: | | |
| mkdir -p release | |
| cd app/extension | |
| zip -r ../../release/huntly-chrome-extension-${{ needs.create-release.outputs.version }}.zip ./dist/* | |
| - name: Upload Chrome extension to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.release_upload_url }} | |
| asset_path: release/huntly-chrome-extension-${{ needs.create-release.outputs.version }}.zip | |
| asset_name: huntly-chrome-extension-${{ needs.create-release.outputs.version }}.zip | |
| asset_content_type: application/zip | |