diff --git a/.gitea/actions/plugin/build-achievements/action.yml b/.gitea/actions/plugin/build-achievements/action.yml new file mode 100644 index 0000000..34930fa --- /dev/null +++ b/.gitea/actions/plugin/build-achievements/action.yml @@ -0,0 +1,63 @@ +name: build +description: Build plugin via yarn & make + +inputs: + go_version: + required: false + description: 'GO version' + go_cache: + required: false + description: 'For direct disable go-cache if needed' + node_version: + required: false + description: 'Node.js version' + +runs: + using: composite + steps: + - name: ci/setup-go + uses: actions/setup-go@v4 + if: ${{ inputs.go_version && inputs.go_cache != 'false' }} + with: + go-version: "${{ inputs.go_version }}" + cache-dependency-path: | + go.sum + server/go.sum + + - name: ci/setup-go-wo-cache + uses: actions/setup-go@v4 + if: ${{ inputs.go_version && inputs.go_cache == 'false' }} + with: + go-version: "${{ inputs.go_version }}" + cache: false + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: ci/setup-node + uses: actions/setup-node@v4 + if: ${{ inputs.node_version }} + with: + node-version: "${{ inputs.node_version }}" +# TODO cache yarn +# cache: "yarn" +# cache-dependency-path: yarn.lock + +# TODO tests +# - name: ci/plugin-test + + - name: ci/install-deps + if: ${{ inputs.node_version }} + shell: bash + run: | + echo "::group::yarn" + cd webapp + yarn install + echo "::endgroup::" + + - name: ci/plugin-build + shell: bash + run: | + echo "::group::dist" + make dist + echo "::endgroup::" diff --git a/.gitea/workflows/loop-plugin-achievements-template.yml b/.gitea/workflows/loop-plugin-achievements-template.yml index 0c112d2..8fe376c 100644 --- a/.gitea/workflows/loop-plugin-achievements-template.yml +++ b/.gitea/workflows/loop-plugin-achievements-template.yml @@ -98,7 +98,7 @@ jobs: echo "EXPERIMENTAL=$(jq -r '.props.experimental == true' plugin.json)" >> "$GITHUB_OUTPUT" - name: ci/plugin-build - uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/build@master + uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/build-achievements@master with: go_version: ${{ inputs.go_version }} go_cache: ${{ inputs.go_cache }}