Run both workflows inside git.nakama.town/fmartingr/ci-images/ci-base, which already provides Bun (and Go, Docker, GoReleaser, etc.). Drops the now-redundant actions/setup-bun step.
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: git.nakama.town/fmartingr/ci-images/ci-base:latest
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: bun run build
|
|
|
|
- name: Package
|
|
run: |
|
|
VERSION="${{ github.ref_name }}"
|
|
PLUGIN_ID=$(bun -p 'JSON.parse(require("fs").readFileSync("manifest.json","utf8")).id')
|
|
STAGING="${PLUGIN_ID}-${VERSION}"
|
|
mkdir -p "${STAGING}"
|
|
cp dist/main.js dist/manifest.json "${STAGING}/"
|
|
if [ -f dist/styles.css ]; then cp dist/styles.css "${STAGING}/"; fi
|
|
tar -czf "dist/${PLUGIN_ID}-${VERSION}.tar.gz" "${STAGING}"
|
|
rm -rf "${STAGING}"
|
|
|
|
- name: Release
|
|
uses: actions/forgejo-release@v2.11.1
|
|
with:
|
|
direction: upload
|
|
url: ${{ github.server_url }}
|
|
repo: ${{ github.repository }}
|
|
tag: ${{ github.ref_name }}
|
|
token: ${{ github.token }}
|
|
release-dir: dist
|