43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Penerbitan Plugin
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
types: ["opened", "synchronize"]
|
|
|
|
jobs:
|
|
persiapan:
|
|
if: "!contains(gitea.event.head_commit.message, 'Merge pull request')"
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
organisasi: ${{ steps.var.outputs.organisasi }}
|
|
steps:
|
|
- name: Persiapan variabel
|
|
id: var
|
|
run: |
|
|
echo "organisasi=$(echo '${{ gitea.repository }}' | cut -d'/' -f1)" \
|
|
>> $GITEA_OUTPUT
|
|
|
|
penerbitan:
|
|
if: "!contains(gitea.event.head_commit.message, 'Merge pull request')"
|
|
runs-on: ubuntu-latest
|
|
needs: persiapan
|
|
steps:
|
|
- name: Unduh program
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Unduh pnpm
|
|
uses: pnpm/action-setup@v6
|
|
with:
|
|
version: 10
|
|
|
|
- name: Unggah program
|
|
run: |
|
|
npm config set @${{ needs.persiapan.outputs.organisasi }}:registry=https://git.segubi.com/api/packages/${{ needs.persiapan.outputs.organisasi }}/npm/
|
|
npm config set -- '//git.segubi.com/api/packages/${{ needs.persiapan.outputs.organisasi }}/npm/:_authToken' "${{ secrets.KATA_SANDI_KUNCI_PENGUNGGAHAN }}"
|
|
npm publish
|