@@ -4,7 +4,7 @@ on:
44 # - cron: '0 0 * * *' # midnight UTC
55
66 push:
7− # tags:
7+ tags:
88 ## - release
99
1010jobs:
@@ -14,31 +14,35 @@ jobs:
1414 strategy:
1515 fail-fast: false # don't fail other jobs if one fails
1616 matrix:
17− build: [linux, linux-arm, macos, win-msvc] #, win-gnu, win32-msvc
17+ build: [x86_64-linux, aarch64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc
1818 include:
19− - build: linux
19+ - build: x86_64-linux
2020 os: ubuntu-20.04
21− rust: nightly
21+ rust: stable
2222 target: x86_64-unknown-linux-musl
23− - build: linux-arm
23+ cross: false
24+ - build: aarch64-linux
2425 os: ubuntu-20.04
25− rust: nightly
26− target: arm-unknown-linux-gnueabihf
27− - build: macos
26+ rust: stable
27+ target: aarch64-unknown-linux-gnu
28+ cross: true
29+ - build: x86_64-macos
2830 os: macos-latest
29− rust: nightly
31+ rust: stable
3032 target: x86_64-apple-darwin
31− - build: win-msvc
33+ cross: false
34+ - build: x86_64-windows
3235 os: windows-2019
33− rust: nightly
36+ rust: stable
3437 target: x86_64-pc-windows-msvc
35− # - build: win-gnu
38+ cross: false
39+ # - build: x86_64-win-gnu
3640 # os: windows-2019
37− # rust: nightly-x86_64-gnu
41+ # rust: stable-x86_64-gnu
3842 # target: x86_64-pc-windows-gnu
3943 # - build: win32-msvc
4044 # os: windows-2019
41− # rust: nightly
45+ # rust: stable
4246 # target: i686-pc-windows-msvc
4347
4448 steps:
@@ -55,32 +59,80 @@ jobs:
5559 target: ${{ matrix.target }}
5660 override: true
5761
58− - name: Build release binary
62+ - name: Run cargo test
5963 uses: actions-rs/cargo@v1
6064 with:
61− use-cross: true
62− command: build
63− args: --release --locked --target ${{ matrix.target }}
65+ command: test
66+ args: --locked
6467
65− - name: Run cargo test
68+ - name: Build release binary
6669 uses: actions-rs/cargo@v1
6770 with:
68− use-cross: true
69− command: test
70− args: --release --locked
71+ use-cross: ${{ matrix.cross }}
72+ command: build
73+ args: --release --locked --target ${{ matrix.target }}
7174
7275 - name: Strip release binary (linux and macos)
73− if: matrix.build == 'linux' || matrix.build == 'macos'
74− run: strip "target/${{ matrix.target }}/release/rg"
76+ if: matrix.build == 'x86_64-linux' || matrix.build == 'x86_64-macos'
77+ run: strip "target/${{ matrix.target }}/release/hx"
7578
7679 - name: Strip release binary (arm)
77− if: matrix.build == 'linux-arm'
80+ if: matrix.build == 'aarch64-linux'
7881 run: |
7982 docker run --rm -v \
8083 "$PWD/target:/target:Z" \
81− rustembedded/cross:arm-unknown-linux-gnueabihf \
82− arm-linux-gnueabihf-strip \
83− /target/arm-unknown-linux-gnueabihf/release/rg
84+ rustembedded/cross:${{ matrix.target }} \
85+ aarch64-linux-gnu-strip \
86+ /target/${{ matrix.target }}/release/hx
87+
88+ - name: Build archive
89+ shell: bash
90+ run: |
91+ outdir="$(ci/cargo-out-dir "${{ env.TARGET_DIR }}")"
92+ staging="helix-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
93+ mkdir -p "$staging"/{complete,doc}
94+ cp {README.md,LICENSE} "$staging/"
95+ # cp {CHANGELOG.md,FAQ.md,GUIDE.md} "$staging/doc/"
96+ # cp "$outdir"/{hx.bash,hx.fish,_hx.ps1} "$staging/complete/"
97+ # cp complete/_hx "$staging/complete/"
98+ if [ "${{ matrix.os }}" = "windows-2019" ]; then
99+ cp "target/${{ matrix.target }}/release/hx.exe" "$staging/"
100+ 7z a "$staging.zip" "$staging"
101+ echo "ASSET=$staging.zip" >> $GITHUB_ENV
102+ else
103+ # The man page is only generated on Unix systems. ¯\_(ツ)_/¯
104+ # cp "$outdir"/hx.1 "$staging/doc/"
105+ cp "target/${{ matrix.target }}/release/hx" "$staging/"
106+ tar czf "$staging.tar.gz" "$staging"
107+ echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
108+ fi
84109
85110 # package
86− # upload to nightly release
111+ - uses: actions/upload-artifact@v1
112+ with:
113+ name: bins-${{ matrix.build }}
114+ path: ${{ env.ASSET }}
115+
116+ publish:
117+ name: Publish
118+ needs: [dist]
119+ runs-on: ubuntu-latest
120+ steps:
121+ - name: Checkout sources
122+ uses: actions/checkout@v2
123+ with:
124+ submodules: false
125+
126+ - uses: actions/download-artifact@v2
127+ with:
128+ path: dist
129+ - run: ls -al ./dist
130+
131+ - name: Upload binaries to release
132+ uses: svenstaro/upload-release-action@v2
133+ with:
134+ repo_token: ${{ secrets.GITHUB_TOKEN }}
135+ file: dist/*
136+ file_glob: true
137+ tag: ${{ github.ref }}
138+ overwrite: true