Skip to content

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm i
- name: Build
run: npm run plugin-zip
- name: Archive production artifact
uses: actions/upload-artifact@v2
with:
name: plugin_zip
path: wp-block-nonogram.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: get tag name
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- 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: |
This is the release for tag ${{ env.TAG }}.
draft: false
prerelease: false
- name: Download production artifact
uses: actions/download-artifact@v2
with:
name: plugin_zip
- name: Upload release artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: wp-block-nonogram.zip
asset_name: wp-block-nonogram_${{ env.TAG }}.zip
asset_content_type: application/zip