From 9639b0fd6bc2aba5796b4ef1d4fd1a1b2a0c4e6c Mon Sep 17 00:00:00 2001 From: MrJackphil Date: Thu, 16 Jun 2022 17:59:12 +0400 Subject: [PATCH] ci: :construction_work: update release-please action --- .github/workflows/release-please.yml | 89 +++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 4ebb399..dc96dc4 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -2,12 +2,99 @@ on: push: branches: - master + +env: + PLUGIN_NAME: mrj-text-expand # Change this to the name of your plugin-id folder + name: release-please jobs: release-please: runs-on: ubuntu-latest steps: + - name: Build + id: build + run: | + npm install + npm run build --if-present + mkdir ${{ env.PLUGIN_NAME }} + cp main.js manifest.json ${{ env.PLUGIN_NAME }} + zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} + ls + echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)" + - uses: google-github-actions/release-please-action@v3 with: release-type: node - package-name: release-please-action + package-name: ${{ env.PLUGIN_NAME }} + extra-files: | + manifest.json + main.js + ${{ env.PLUGIN_NAME }}.zip + + # - uses: actions/checkout@v2 + # if: ${{ steps.release.outputs.release_created }} + + # - name: Use Node.js + # uses: actions/setup-node@v1 + # with: + # node-version: '14.x' # You might need to adjust this value to your own version + # if: ${{ steps.release.outputs.release_created }} + + # - name: Create Release + # id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # VERSION: ${{ github.ref }} + # with: + # tag_name: ${{ github.ref }} + # release_name: ${{ github.ref }} + # draft: false + # prerelease: false + # if: ${{ steps.release.outputs.release_created }} + + # - name: Upload zip file + # id: upload-zip + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./${{ env.PLUGIN_NAME }}.zip + # asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip + # asset_content_type: application/zip + # if: ${{ steps.release.outputs.release_created }} + + # - name: Upload main.js + # id: upload-main + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./main.js + # asset_name: main.js + # asset_content_type: text/javascript + # if: ${{ steps.release.outputs.release_created }} + + # - name: Upload manifest.json + # id: upload-manifest + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./manifest.json + # asset_name: manifest.json + # asset_content_type: application/json + # if: ${{ steps.release.outputs.release_created }} + # - name: Upload styles.css + # id: upload-css + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./styles.css + # asset_name: styles.css + # asset_content_type: text/css