@@ -86,49 +86,31 @@ jobs:
8686 aarch64-linux-gnu-strip \
8787 /target/${{ matrix.target }}/release/hx
8888
89− - name: Calculate tag name
90− run: |
91− name=dev
92− if [[ $GITHUB_REF == refs/tags/v* ]]; then
93− name=${GITHUB_REF:10}
94− fi
95− echo ::set-output name=val::$name
96− echo TAG=$name >> $GITHUB_ENV
97− id: tagname
98−
9989 - name: Build archive
10090 shell: bash
10191 run: |
102− # outdir="$(ci/cargo-out-dir "${{ env.TARGET_DIR }}")"
103− staging="helix-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
104− mkdir "$staging"
105− cp {README.md,LICENSE} "$staging/"
106− # cp {CHANGELOG.md,FAQ.md,GUIDE.md} "$staging/doc/"
107− # cp "$outdir"/{hx.bash,hx.fish,_hx.ps1} "$staging/complete/"
108− # cp complete/_hx "$staging/complete/"
92+ mkdir dist
10993 if [ "${{ matrix.os }}" = "windows-2019" ]; then
110− cp "target/${{ matrix.target }}/release/hx.exe" "$staging/"
111− 7z a "$staging.zip" "$staging"
112− echo "ASSET=$staging.zip" >> $GITHUB_ENV
94+ cp "target/${{ matrix.target }}/release/hx.exe" "dist/"
11395 else
114− # The man page is only generated on Unix systems. ¯\_(ツ)_/¯
115− # cp "$outdir"/hx.1 "$staging/doc/"
116− cp "target/${{ matrix.target }}/release/hx" "$staging/"
117− tar czf "$staging.tar.gz" "$staging"
118− echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
96+ cp "target/${{ matrix.target }}/release/hx" "dist/"
11997 fi
12098
121− # package
12299 - uses: actions/upload-artifact@v1
123100 with:
124− name: tarballs-${{ matrix.build }}
125− path: ${{ env.ASSET }}
101+ name: bins-${{ matrix.build }}
102+ path: dist
126103
127104 publish:
128105 name: Publish
129106 needs: [dist]
130107 runs-on: ubuntu-latest
131108 steps:
109+ - name: Checkout sources
110+ uses: actions/checkout@v2
111+ with:
112+ submodules: false
113+
132114 - uses: actions/download-artifact@v2
133115 with:
134116 path: dist
@@ -144,11 +126,39 @@ jobs:
144126 echo TAG=$name >> $GITHUB_ENV
145127 id: tagname
146128
129+ - name: Build archive
130+ shell: bash
131+ run: |
132+ set -euxo pipefail
133+
134+ rm -rf tmp
135+ mkdir tmp
136+ mkdir dist
137+
138+ for dir in bins-* ; do
139+ platform=${dir#"bins-"}
140+ if [[ $platform =~ "windows" ]]; then
141+ exe=".exe"
142+ fi
143+ pkgname=helix-$TAG-$platform
144+ mkdir tmp/$pkgname
145+ cp LICENSE README.md tmp/$pkgname
146+ cp -r runtime tmp/$pkgname/
147+ mv bins-$platform/hx$exe tmp/$pkgname
148+ chmod +x tmp/$pkgname/hx$exe
149+
150+ if [ "$exe" = "" ]; then
151+ tar cJf dist/$pkgname.tar.xz -C tmp $pkgname
152+ else
153+ (cd tmp && 7z a -r ../dist/$pkgname.zip $pkgname)
154+ fi
155+ done
156+
147157 - name: Upload binaries to release
148158 uses: svenstaro/upload-release-action@v2
149159 with:
150160 repo_token: ${{ secrets.GITHUB_TOKEN }}
151− file: dist/**/*
161+ file: dist/*
152162 file_glob: true
153163 tag: ${{ steps.tagname.outputs.val }}
154164 overwrite: true