diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f23ea6..4f7e4a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,21 +13,21 @@ 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: Build - id: build - run: | - npm install - npm run build - mkdir ${{ env.PLUGIN_NAME }} - cp ./build/main.js ./build/manifest.json ./build/styles.css ${{ 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: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Build + id: build + run: | + npm install + npm run build + mkdir ${{ env.PLUGIN_NAME }} + cp ./build/main.js ./build/manifest.json ./build/styles.css ${{ 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)" - name: Create Release id: create_release uses: actions/create-release@v1 @@ -39,56 +39,46 @@ jobs: release_name: ${{ github.ref }} draft: false prerelease: false - - name: Upload zip file - id: upload-zip - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PKMER_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 - - - name: Upload main.js - id: upload-main - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PKMER_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/main.js - asset_name: main.js - asset_content_type: text/javascript + - name: Upload zip file + id: upload-zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PKMER_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 - - name: Upload manifest.json - id: upload-manifest - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PKMER_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/manifest.json - asset_name: manifest.json - asset_content_type: application/json + - name: Upload main.js + id: upload-main + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PKMER_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build/main.js + asset_name: main.js + asset_content_type: text/javascript - - name: Upload styles.css - id: upload-css - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PKMER_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/styles.css - asset_name: styles.css - asset_content_type: text/css - + - name: Upload manifest.json + id: upload-manifest + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PKMER_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build/manifest.json + asset_name: manifest.json + asset_content_type: application/json - uses: garygrossgarten/github-action-scp@release - with: #we will upload data from folder in git hab actions to folder on server - local: tmp - remote: /www/wwwroot/pkmer.cn/_release/ - host: ${{ secrets.HOST }} - port: ${{ secrets.PORT }} - username: www - password: ${{ secrets.SSH_PASSWORD }} + - name: Upload styles.css + id: upload-css + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.PKMER_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build/styles.css + asset_name: styles.css + asset_content_type: text/css