Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ahai-code committed Apr 1, 2024
1 parent 61dce5e commit 45b0aed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
tags: [ 'v*' ]

permissions:
contents: write

jobs:
generate-manifest-json:
runs-on: ubuntu-latest
Expand All @@ -29,7 +32,7 @@ jobs:
sudo lua -e '
require("metadata");
local dkjson = require("dkjson");
PLUGIN.downloadUrl = "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/${{ env.REPO_NAME }}_${{ env.VERSION }}.zip";
PLUGIN.downloadUrl = "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/${{ env.REPO_NAME }}-${{ env.VERSION }}.zip";
local str = dkjson.encode(PLUGIN);
print(str)' > manifest.json
cat manifest.json
Expand All @@ -39,9 +42,9 @@ jobs:
name: manifest
path: manifest.json
release-plugin-and-manifest:
needs: generate-manifest-json
runs-on: ubuntu-latest
steps:
needs: generate-manifest-json
runs-on: ubuntu-latest
steps:
- name: Set repo name
run: |
echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV
Expand All @@ -57,13 +60,13 @@ jobs:
with:
type: "zip"
directory: "./"
filename: "${{ env.REPO_NAME }}_${{ env.VERSION }}.zip"
filename: "${{ env.REPO_NAME }}-${{ env.VERSION }}.zip"
exclusions: "*.git* manifest.json"
- name: Publish release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ env.REPO_NAME }}_${{ env.VERSION }}.zip
file: ./${{ env.REPO_NAME }}-${{ env.VERSION }}.zip
tag: v${{ env.VERSION }}
file_glob: true
- name: Publish manifest
Expand Down
2 changes: 1 addition & 1 deletion metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PLUGIN = {}
--- Plugin name
PLUGIN.name = "java"
--- Plugin version
PLUGIN.version = "0.1.0"
PLUGIN.version = "0.1.1"
--- Plugin homepage
PLUGIN.homepage = "https://github.com/version-fox/vfox-java"
--- Plugin license, please choose a correct license according to your needs.
Expand Down

0 comments on commit 45b0aed

Please sign in to comment.