Skip to content

Commit 9a27dad

Browse files
committed
add dart pubcache support
1 parent e03cba3 commit 9a27dad

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/generator.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- javascript
1616
- javascript(pnpm)
1717
- rust
18+
- dart
1819

1920
REPO:
2021
description: "github repo name: XTLS/Xray-core"
@@ -65,7 +66,7 @@ jobs:
6566
git config --global user.name "github-actions[bot]"
6667
git tag --delete ${P} || echo yes
6768
68-
- name: update go version
69+
- name: Setup go
6970
if: inputs.LANG == 'golang'
7071
uses: actions/setup-go@v6
7172
with:
@@ -135,6 +136,25 @@ jobs:
135136
cd "input/${WORKDIR}"
136137
pycargoebuild --crate-tarball --distdir /tmp/ --license-mapping /tmp/license-mapping.conf
137138
139+
- name: Setup dart
140+
if: inputs.LANG == 'dart'
141+
uses: dart-lang/setup-dart@v1
142+
with:
143+
sdk: stable
144+
145+
- name: Generate dart pubcache
146+
if: inputs.LANG == 'dart'
147+
env:
148+
P: ${{ inputs.P }}
149+
WORKDIR: ${{ inputs.WORKDIR }}
150+
PUB_CACHE: ${{ inputs.P }}/pubcache
151+
run: |
152+
git tag ${P} -m "${P}-dart.tar.xz"
153+
cd "input/${WORKDIR}"
154+
dart --disable-analytics
155+
dart pub get
156+
tar --create --auto-compress --file /tmp/${P}-pubcache.tar.xz ${{ inputs.P }}
157+
138158
- name: push tag
139159
uses: ad-m/github-push-action@master
140160
with:
@@ -182,3 +202,11 @@ jobs:
182202
/tmp/*-crates.tar.xz
183203
input/${{ inputs.WORKDIR }}/*.ebuild
184204
tag_name: ${{ inputs.P }}
205+
206+
- name: upload rust crates to release artifaces
207+
if: inputs.LANG == 'dart'
208+
uses: softprops/action-gh-release@v2
209+
with:
210+
files: |
211+
/tmp/*-pubcache.tar.xz
212+
tag_name: ${{ inputs.P }}

0 commit comments

Comments
 (0)