File tree Expand file tree Collapse file tree 1 file changed +67
-0
lines changed Expand file tree Collapse file tree 1 file changed +67
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : publish
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' *-v*.*.*'
7
+
8
+ jobs :
9
+ to_publish :
10
+ runs-on : ubuntu-latest
11
+
12
+ permissions :
13
+ pull-requests : read
14
+
15
+ outputs :
16
+ package : ${{ steps.package.outputs.package }}
17
+ brick : ${{ steps.brick.outputs.brick }}
18
+
19
+ steps :
20
+ - name : 📚 Git Checkout
21
+ uses : actions/checkout@v3
22
+
23
+ - name : 📦 Finding a package to publish
24
+ id : package
25
+ run : |
26
+ tag=${GITHUB_REF#refs/*/}
27
+ package=$(echo $tag | sed -En "s/^(.*)-v(.*)/\1/p")
28
+ if [[ -d "packages/$package" ]]; then
29
+ echo "::set-output name=package::${package}"
30
+ fi
31
+
32
+ - name : 🧱 Finding a brick to publish
33
+ id : brick
34
+ if : steps.package.outputs.action == ''
35
+ run : |
36
+ tag=${GITHUB_REF#refs/*/}
37
+ brick=$(echo $tag | sed -En "s/^(.*)-v(.*)/\1/p")
38
+ if [[ -d "bricks/$brick" ]]; then
39
+ echo "::set-output name=brick::${brick}"
40
+ fi
41
+
42
+ failed_to_find :
43
+ needs : to_publish
44
+ if : needs.to_publish.outputs.package == '' && needs.to_publish.outputs.brick == ''
45
+ runs-on : ubuntu-latest
46
+
47
+ steps :
48
+ - name : 😢 No package or brick found to publish
49
+ run : exit 1
50
+
51
+ publish_package :
52
+ needs : to_publish
53
+ if : needs.to_publish.outputs.package != ''
54
+
55
+ uses : VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_pub_publish.yml@v1
56
+ with :
57
+ working-directory : packages/${{ needs.to_publish.outputs.package }}
58
+ pub_credentials : secrets.PUB_CREDENTIALS
59
+
60
+ publish_brick :
61
+ needs : to_publish
62
+ if : needs.to_publish.outputs.brick != ''
63
+
64
+ uses : VeryGoodOpenSource/very_good_workflows/.github/workflows/mason_publish.yml@v1
65
+ with :
66
+ working-directory : bricks/${{ needs.to_publish.outputs.brick }}
67
+ mason_credentials : secrets.MASON_CREDENTIALS
You can’t perform that action at this time.
0 commit comments