Skip to content

fix(ci): releaes needs package #4

fix(ci): releaes needs package

fix(ci): releaes needs package #4

Workflow file for this run

name: Package and Release
on:
push:
branches:
- main
tags:
- "*"
jobs:
package:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Bundle
run: npm run bundle
- name: Upload Package
uses: actions/upload-artifact@v3
with:
name: package
path: dist/*.zip
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: package
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download Package
uses: actions/download-artifact@v3
with:
name: package
path: dist
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Package to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/*.zip
asset_name: elementor-media-validator-plugin.zip
asset_content_type: application/zip