fix(workflow): fixes lack of talent #5
Workflow file for this run
This file contains 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: Create release on tag | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' | |
jobs: | |
check_version: | |
name: Check version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install jq | |
run: | | |
sudo apt update -y | |
sudo apt install -y jq | |
- name: Check npm version | |
shell: bash | |
run: | | |
tag_version=$(echo $GITHUB_REF_NAME | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+.*") | |
npm_version=$(jq -r '.version' ./manifest.json) | |
echo "$tag_version" "$npm_version" | |
[ "$tag_version" = "$npm_version" ] | |
build: | |
needs: | |
- check_version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Build | |
run: | | |
npm ci | |
npm run build | |
- name: Save dist file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: ./dist | |
release: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download build | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: ./dist | |
- name: Create release dist | |
run: | | |
tar -cvf ./release.tar.gz ./dist/ ./package.json ./workers/ ./manifest.json ./static | |
- name: Create github release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ./release.tar.gz | |