Skip to content

Commit b09bf3a

Browse files
committed
cd for windows
1 parent 8660a06 commit b09bf3a

2 files changed

Lines changed: 29 additions & 22 deletions

File tree

.github/workflows/cd.www.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
go $filename Linux x86_64
5858
./out/Linux/x86_64 --version | awk '{print $2}' > out/VERSION
5959
;;
60+
*+windows+x86-64.tar.xz)
61+
go $filename Windows x86_64;;
6062
esac
6163
done
6264

.github/workflows/cd.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
qa:
1818
strategy:
1919
matrix:
20-
os: [ubuntu-latest, macos-latest]
20+
os: [ubuntu-latest, macos-latest, windows-latest]
2121
runs-on: ${{ matrix.os }}
2222
steps:
2323
- uses: actions/checkout@v4
@@ -40,12 +40,10 @@ jobs:
4040
- name: include GPG pubkey
4141
run: echo "${{ secrets.GPG_PUBLIC_KEY }}" | base64 -d > $FILENAME/pkgx.dev.pub.asc
4242
- run: tar cJf $FILENAME.tar.xz $FILENAME
43-
- run: tar czf $FILENAME.tar.gz $FILENAME
4443
- name: attach srcs to release
4544
run: gh release upload --clobber
4645
v${{ github.event.inputs.version }}
4746
../$FILENAME.tar.xz
48-
../$FILENAME.tar.gz
4947
working-directory:
5048
${{ env.FILENAME }}
5149
env:
@@ -67,20 +65,24 @@ jobs:
6765
platform:
6866
- os: ["self-hosted", "macOS", "X64"]
6967
build-id: darwin+x86-64
68+
pkgs: gh
7069
- os: ubuntu-latest
7170
container: debian:buster-slim
7271
build-id: linux+x86-64
73-
- os: [self-hosted, macOS, ARM64]
72+
pkgs: gh
73+
- os: macos-latest
7474
build-id: darwin+aarch64
7575
- os: [self-hosted, linux, ARM64]
7676
build-id: linux+aarch64
77-
pkgs: llvm.org perl gnu.org/make xz
77+
pkgs: llvm.org perl gnu.org/make xz gh
78+
- os: windows-latest
79+
build-id: windows+x86-64
7880
fail-fast: false
7981
runs-on: ${{ matrix.platform.os }}
8082
name: ${{ matrix.platform.build-id }}
8183
container: ${{ matrix.platform.container }}
8284
env:
83-
FILENAME: pkgx-${{ github.event.inputs.version }}+${{ matrix.platform.build-id }}.tar.xz
85+
BASENAME: pkgx-${{ github.event.inputs.version }}+${{ matrix.platform.build-id }}.tar
8486
steps:
8587
- uses: actions/download-artifact@v4
8688
with:
@@ -99,27 +101,30 @@ jobs:
99101
apt-get update
100102
apt-get install curl gcc perl-modules openssl make xz-utils --yes;;
101103
esac
104+
if: ${{ runner.os == 'Linux' }}
105+
106+
- name: Prep
107+
if: ${{ runner.os == 'Windows' }}
108+
run: echo "EXT=.exe" >> $GITHUB_ENV
102109

103110
- run: tar xJf pkgx-${{ github.event.inputs.version }}.tar.xz --strip-components=1
104111

105112
- uses: dtolnay/rust-toolchain@stable
106113

107-
- run: |
108-
cargo build --release
109-
if: ${{ runner.os != 'Linux' }}
110-
111114
# hack to statically link libgcc
112115
- run: |
113116
echo '#!/bin/bash' > linkerdriver.wrap
114117
echo 'exec "${CC:-cc}" "${@/-lgcc_s/-lgcc_eh}"' >> linkerdriver.wrap
115118
chmod +x ./linkerdriver.wrap
116-
117-
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="$PWD/linkerdriver.wrap" cargo build --release
119+
echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=$PWD/linkerdriver.wrap" >> $GITHUB_ENV
118120
if: ${{ runner.os == 'Linux' }}
119121
120122
- run: |
121-
mv target/release/pkgx .
122-
strip ./pkgx
123+
cargo build --release
124+
mv target/release/pkgx$EXT .
125+
126+
- run: strip ./pkgx
127+
if: ${{ runner.os != 'Windows' }}
123128

124129
- uses: pkgxdev/pantry/.github/actions/setup@main
125130
if: startsWith(matrix.platform.build-id, 'darwin+')
@@ -138,9 +143,11 @@ jobs:
138143
- name: sanity check
139144
run: test "$(./pkgx --version)" = "pkgx ${{ github.event.inputs.version }}"
140145

141-
- run: tar cJf $FILENAME pkgx
146+
- run: |
147+
tar cJf $BASENAME.xz pkgx$EXT
148+
tar czf $BASENAME.gz pkgx$EXT
142149
143-
- name: GPG sign archive
150+
- name: GPG sign archives
144151
run: |
145152
./pkgx gpg-agent --daemon || true
146153
echo $GPG_PRIVATE_KEY | \
@@ -149,18 +156,16 @@ jobs:
149156
./pkgx gpg \
150157
--detach-sign --armor \
151158
--local-user $GPG_KEY_ID \
152-
$FILENAME
159+
$BASENAME.xz
153160
env:
154161
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
155162
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
156-
157-
- run: echo 'naughty-boy' > $FILENAME.asc
158-
if: matrix.platform.build-id == 'linux+x86-64'
163+
if: ${{ runner.os != 'Windows' }}
159164

160165
- name: attach product to release
161-
run: ./pkgx gh release upload --clobber
166+
run: gh release upload --clobber
162167
v${{ github.event.inputs.version }}
163-
$FILENAME $FILENAME.asc
168+
$BASENAME.xz $BASENAME.gz $BASENAME.xz.asc
164169
env:
165170
# using this token rather than github.token due to `release not found` bug
166171
# https://github.com/pkgxdev/cli/issues/5252

0 commit comments

Comments
 (0)