Skip to content

Commit 1333458

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

2 files changed

Lines changed: 21 additions & 14 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: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -74,13 +72,15 @@ jobs:
7472
build-id: darwin+aarch64
7573
- os: [self-hosted, linux, ARM64]
7674
build-id: linux+aarch64
77-
pkgs: llvm.org perl gnu.org/make xz
75+
pkgs: llvm.org perl gnu.org/make xz gh
76+
- os: windows-latest
77+
build-id: windows+x86-64
7878
fail-fast: false
7979
runs-on: ${{ matrix.platform.os }}
8080
name: ${{ matrix.platform.build-id }}
8181
container: ${{ matrix.platform.container }}
8282
env:
83-
FILENAME: pkgx-${{ github.event.inputs.version }}+${{ matrix.platform.build-id }}.tar.xz
83+
BASENAME: pkgx-${{ github.event.inputs.version }}+${{ matrix.platform.build-id }}.tar
8484
steps:
8585
- uses: actions/download-artifact@v4
8686
with:
@@ -98,6 +98,8 @@ jobs:
9898
linux+x86-64)
9999
apt-get update
100100
apt-get install curl gcc perl-modules openssl make xz-utils --yes;;
101+
windows+x86-64)
102+
echo "EXT=.exe" >> $GITHUB_ENV;;
101103
esac
102104
103105
- run: tar xJf pkgx-${{ github.event.inputs.version }}.tar.xz --strip-components=1
@@ -118,8 +120,10 @@ jobs:
118120
if: ${{ runner.os == 'Linux' }}
119121
120122
- run: |
121-
mv target/release/pkgx .
122-
strip ./pkgx
123+
mv target/release/pkgx$EXT .
124+
if [ ${{ runner.os }} != Windows ]; then
125+
strip ./pkgx
126+
fi
123127
124128
- uses: pkgxdev/pantry/.github/actions/setup@main
125129
if: startsWith(matrix.platform.build-id, 'darwin+')
@@ -138,9 +142,11 @@ jobs:
138142
- name: sanity check
139143
run: test "$(./pkgx --version)" = "pkgx ${{ github.event.inputs.version }}"
140144

141-
- run: tar cJf $FILENAME pkgx
145+
- run: |
146+
tar cJf $BASENAME.xz pkgx$EXT
147+
tar czf $BASENAME.gz pkgx$EXT
142148
143-
- name: GPG sign archive
149+
- name: GPG sign archives
144150
run: |
145151
./pkgx gpg-agent --daemon || true
146152
echo $GPG_PRIVATE_KEY | \
@@ -149,18 +155,17 @@ jobs:
149155
./pkgx gpg \
150156
--detach-sign --armor \
151157
--local-user $GPG_KEY_ID \
152-
$FILENAME
158+
$BASENAME.xz
159+
done
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)