2023-08-27 23:42:27 +08:00
|
|
|
name: release
|
|
|
|
|
2023-08-27 23:38:13 +08:00
|
|
|
on:
|
|
|
|
push:
|
2023-09-06 10:43:57 +08:00
|
|
|
branches:
|
|
|
|
- main
|
2023-08-27 23:38:13 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release-please:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
|
|
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: release-please
|
|
|
|
id: release
|
2024-06-02 21:33:33 +08:00
|
|
|
uses: googleapis/release-please-action@v4
|
2023-08-27 23:38:13 +08:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
release-type: node
|
|
|
|
|
2023-08-30 00:40:47 +08:00
|
|
|
release-assets:
|
2023-08-27 23:38:13 +08:00
|
|
|
needs: release-please
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ needs.release-please.outputs.release_created }}
|
|
|
|
steps:
|
2023-09-17 13:23:12 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-27 23:38:13 +08:00
|
|
|
|
2024-05-08 09:18:17 +08:00
|
|
|
- uses: pnpm/action-setup@v4
|
2024-04-08 17:34:57 +08:00
|
|
|
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
cache: pnpm
|
|
|
|
node-version: latest
|
2023-08-27 23:38:13 +08:00
|
|
|
|
2023-08-28 00:55:08 +08:00
|
|
|
- name: install dependencies
|
2024-04-08 17:34:57 +08:00
|
|
|
run: pnpm install
|
2023-08-28 00:55:08 +08:00
|
|
|
|
2023-08-30 10:18:11 +08:00
|
|
|
- name: build
|
2024-04-08 17:34:57 +08:00
|
|
|
run: pnpm build
|
2023-08-27 23:38:13 +08:00
|
|
|
|
2023-08-30 00:40:47 +08:00
|
|
|
- name: publish gh-pages
|
2024-04-09 09:29:41 +08:00
|
|
|
uses: peaceiris/actions-gh-pages@v4
|
2023-08-27 23:42:27 +08:00
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./dist
|
2023-09-25 22:08:06 +08:00
|
|
|
force_orphan: true
|
2023-09-02 01:17:30 +08:00
|
|
|
cname: d.metacubex.one
|
2023-09-28 15:57:58 +08:00
|
|
|
commit_message: ${{ needs.release-please.outputs.tag_name }}
|
2023-08-27 23:51:13 +08:00
|
|
|
|
2023-09-25 21:01:39 +08:00
|
|
|
- name: compress dist
|
|
|
|
run: tar czvf compressed-dist.tgz -C dist .
|
2023-08-27 23:58:51 +08:00
|
|
|
|
2023-08-30 00:40:47 +08:00
|
|
|
- name: attach github release artifacts
|
2024-03-09 16:23:17 +08:00
|
|
|
uses: softprops/action-gh-release@v2
|
2023-08-27 23:51:13 +08:00
|
|
|
with:
|
2023-09-25 21:01:39 +08:00
|
|
|
files: compressed-dist.tgz
|
2023-08-27 23:51:13 +08:00
|
|
|
tag_name: ${{ needs.release-please.outputs.tag_name }}
|
2023-08-30 00:40:47 +08:00
|
|
|
|
|
|
|
release-image:
|
|
|
|
needs: release-please
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ needs.release-please.outputs.release_created }}
|
|
|
|
steps:
|
2023-09-17 13:23:12 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-30 00:40:47 +08:00
|
|
|
|
|
|
|
- name: set up QEMU
|
2023-09-17 13:20:13 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-08-30 00:40:47 +08:00
|
|
|
|
|
|
|
- name: set up docker buildx
|
2023-09-17 13:20:13 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2023-08-30 00:40:47 +08:00
|
|
|
id: buildx
|
|
|
|
|
2023-09-06 10:43:57 +08:00
|
|
|
- name: login to ghcr.io
|
2023-09-17 13:20:13 +08:00
|
|
|
uses: docker/login-action@v3
|
2023-08-30 00:40:47 +08:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: build and publish ghcr.io docker image
|
2024-06-18 09:28:28 +08:00
|
|
|
uses: docker/build-push-action@v6
|
2023-08-30 00:40:47 +08:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
file: Dockerfile
|
2023-08-30 10:33:58 +08:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2023-08-30 00:40:47 +08:00
|
|
|
push: true
|
|
|
|
tags: |
|
2023-08-30 00:44:10 +08:00
|
|
|
ghcr.io/metacubex/metacubexd:latest
|
2024-11-23 17:02:56 +08:00
|
|
|
ghcr.io/metacubex/metacubexd:${{ needs.release-please.outputs.tag_name }}
|
2023-08-30 00:40:47 +08:00
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|