Skip to content

Commit 542a701

Browse files
committed
new installer logic etc.
1 parent 099ceb6 commit 542a701

File tree

6 files changed

+75
-12
lines changed

6 files changed

+75
-12
lines changed

.github/workflows/cd.installer.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: cd·installer
2+
13
on:
24
pull_request:
35
paths:
@@ -10,6 +12,7 @@ on:
1012

1113
jobs:
1214
cd:
15+
if: github.repository == 'pkgxdev/mash'
1316
runs-on: ubuntu-latest
1417
steps:
1518
- uses: actions/checkout@v4
@@ -25,3 +28,10 @@ jobs:
2528
- run: aws cloudfront create-invalidation
2629
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }}
2730
--paths / /installer.sh
31+
32+
test:
33+
needs: cd
34+
runs-on: ubuntu-latest
35+
steps:
36+
- run: curl -L mash.pkgx.sh | sh
37+
- run: mash demo test-pattern

.github/workflows/cd.www.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: cd·www
2+
13
on:
24
push:
35
branches: main
@@ -34,6 +36,13 @@ jobs:
3436
mkdir out
3537
.github/scripts/index.ts --input ./build > ./out/index.json
3638
39+
- uses: robinraju/[email protected]
40+
with:
41+
latest: true
42+
fileName: mash-*.sh
43+
44+
- run: mv mash-*.sh ./out/mash.sh
45+
3746
- name: build
3847
run: .github/scripts/build.ts --input ./build --output ./out --index-json ./out/index.json
3948

.github/workflows/cd.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: cd·vx
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
concurrency:
9+
group: cd/vx/${{ github.event.release.tag_name }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
retag:
17+
if: github.repository == 'pkgxdev/mash'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: fischerscode/tagger@v0
22+
with:
23+
prefix: v
24+
- run: |
25+
git tag -f latest
26+
git push origin latest --force
27+
28+
attach:
29+
if: github.repository == 'pkgxdev/mash'
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: version
35+
run: sed -i "s/mash 0.0.0-dev/mash ${{ github.event.release.tag_name }}/g" ./mash
36+
37+
- name: prep
38+
run: |
39+
mkdir out
40+
mv ./mash ./out/mash-${{ github.event.release.tag_name }}.sh
41+
42+
- name: attach
43+
run: gh release upload ${{ github.event.release.tag_name }} ./out/mash-${{ github.event.release.tag_name }}.sh
44+
env:
45+
GH_TOKEN: ${{ github.token }}

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
name: ci
2+
13
on:
24
pull_request:
35
paths: mash
46

57
jobs:
68
test:
9+
if: github.repository == 'pkgxdev/mash'
710
runs-on: ubuntu-latest
811
steps:
912
- uses: actions/checkout@v4

installer.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,8 @@ fi
2626
if [ $# -gt 0 ]; then
2727
exec pkgx +pkgx.sh/mash -- mash "$@"
2828
else
29-
pkgx install mash
30-
31-
if [ -f /usr/bin/which ]; then
32-
pkgxd="$(dirname "$(which pkgx)")"
33-
34-
if [ ! -w "$pkgxd" ]; then
35-
SUDO=sudo
36-
fi
37-
38-
$SUDO mv $HOME/.local/bin/mash "$pkgxd"
39-
fi
40-
29+
tmp="$(mktemp)"
30+
curl -Ssf https://pkgxdev.github.io/mash/mash.sh > $tmp
31+
sudo install -m 0755 "$tmp" /usr/local/bin/mash
4132
echo "now type: mash" 1>&2
4233
fi

mash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -eo pipefail
44

5+
if [ "$1" == --version ]; then
6+
echo "mash 0.0.0-dev"
7+
exit 0
8+
fi
9+
510
if [ -n "$RUNNER_DEBUG" -a -n "$GITHUB_ACTIONS" ] || [ -n "$VERBOSE" ]; then
611
set -x
712
fi

0 commit comments

Comments
 (0)