include completions, docs, etc in the final artifact
also updates the artifact name to include version
@@ -67,18 +67,32 @@ jobs:
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --release --target ${{ matrix.job.target }}
+
+ - id: get_version
+ uses: battila7/get-version-action@v2
- name: Package
shell: bash
run: |
- cd target/${{ matrix.job.target }}/release
if [ "${{ matrix.job.os }}" = "windows-latest" ]; then
- 7z a ../../../xh-${{ matrix.job.target }}.zip xh.exe
+ bin="target/${{ matrix.job.target }}/release/xh.exe"
+ else
+ bin="target/${{ matrix.job.target }}/release/xh"
+ fi
+ staging="xh-${{ steps.get_version.outputs.version }}-${{ matrix.job.target }}"
+
+ mkdir -p "$staging"/{doc,completions}
+ cp LICENSE README.md $bin $staging
+ cp CHANGELOG.md doc/xh.1 "$staging"/doc
+ cp completions/* "$staging"/completions
+
+ if [ "${{ matrix.job.os }}" = "windows-latest" ]; then
+ 7z a "$staging.zip" $staging
elif [ "${{ matrix.job.os }}" = "macos-latest" ]; then
- zip ../../../xh-${{ matrix.job.target }}.zip xh
+ zip -r "$staging.zip" $staging
else
- tar czvf ../../../xh-${{ matrix.job.target }}.tar.gz xh
+ tar czvf "$staging.tar.gz" $staging
fi
- cd -
+
- name: Publish
uses: softprops/action-gh-release@v1
with:
