Skip to content

updated CICD

updated CICD #13

Workflow file for this run

name: Release Google Chrome Extension
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Get package info and release type
id: package_info
run: |
echo "name=$(node -p "require('./manifest.json').name")" >> $GITHUB_OUTPUT
echo "version=$(node -p "require('./manifest.json').version")" >> $GITHUB_OUTPUT
RELEASE_TYPE=$(echo ${{ github.ref }} | sed -E 's/.*v[0-9]+\.[0-9]+\.[0-9]+_?(.*)$/\1/')
echo "type=${RELEASE_TYPE:-stable}" >> $GITHUB_OUTPUT
- name: Set release name
id: release_name
run: |
echo "name=${{ steps.package_info.outputs.name }}_v${{ steps.package_info.outputs.version }}_${{ steps.package_info.outputs.type }}_$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Zip Extension
run: zip -r extension.zip dist
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.release_name.outputs.name }}
draft: false
prerelease: ${{ steps.package_info.outputs.type != 'stable' }}
- 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: ./extension.zip
asset_name: ${{ steps.release_name.outputs.name }}.zip
asset_content_type: application/zip