Skip to content

Commit

Permalink
ts → rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 14, 2025
1 parent 6a195bf commit ea6da1e
Show file tree
Hide file tree
Showing 154 changed files with 5,138 additions and 7,771 deletions.
34 changes: 20 additions & 14 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
root:
./docs/
redirects:
pantry: pantry.md
shell-integration: shell-integration.md
shellcode: shell-integration.md
getting-started: run/anywhere/terminals.md
quickstart: run/anywhere/terminals.md
installing-w/out-brew: run/anywhere/terminals.md
docker: run/anywhere/docker.md
ci-cd: run/anywhere/ci-cd.md
scripts: run/anywhere/scripts.md
editors: run/anywhere/editors.md
pkgx-install: pkgx-install.md
install: pkgx-install.md
support: support.md
dev: dev.md
installing-w/out-brew: getting-started.md
pantry: pkging/pantry.md
getting-started: getting-started.md
quickstart: getting-started.md

help/pkg-not-cached: https://github.com/orgs/pkgxdev/discussions/new?category=help&title=pkg-not-cached
help/http-failure: https://github.com/orgs/pkgxdev/discussions/new?category=help&title=http-failure
help/ambiguous-pkgspec: https://github.com/orgs/pkgxdev/discussions/new?category=help&title=ambiguous-pkgspec

# links should never die
docker: getting-started.md
ci-cd: getting-started.md
scripts: scripting.md
run/anywhere/terminals.md: getting-started.md
run/anywhere/docker.md: getting-started.md
run/anywhere/ci-cd.md: getting-started.md
run/anywhere/scripts.md: scripting.md
pantry.md: pkging/pantry.md
pantry-api.md: pkging/pantry.md
pkgx-install: https://github.com/pkgxdev/pkgm
install: https://github.com/pkgxdev/pkgm
support: https://github.com/pkgxdev/discussions
dev: https://github.com/pkgxdev/dev
7 changes: 4 additions & 3 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM debian:buster-slim as stage0
COPY ./products/* /pkgx/
RUN cp /pkgx/$(uname -m) /usr/local/bin/pkgx
RUN install -m 755 /pkgx/$(uname -m) /usr/local/bin/pkgx
RUN install -m 755 /pkgx/pkgm /usr/local/bin/pkgm
RUN echo 'export PS1="\\[\\033[38;5;63m\\]pkgx\\[\\033[0m\\]\\w $ "' >> /root/.bashrc
RUN pkgx integrate

FROM debian:buster-slim as stage1
RUN apt-get update && apt --yes install libc-dev libstdc++-8-dev libgcc-8-dev netbase libudev-dev
RUN apt-get update && apt --yes install libc-dev libstdc++-8-dev libgcc-8-dev netbase libudev-dev ca-certificates
COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgx
COPY --from=stage0 /usr/local/bin/pkgm /usr/local/bin/pkgm
COPY --from=stage0 /root/.bashrc /root/.bashrc
ENV BASH_ENV /root/.bashrc
SHELL ["/bin/bash", "-c"]
Expand Down
41 changes: 13 additions & 28 deletions .github/markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
# use banner rather than an h1 at the top of the file
MD041: false

# extra lines to offset content
MD012: false

# skipping heading levels as needed for display purposes
MD001: false
default:
true

# "prompts" in code examples
MD014: false

# consecutive distinct blockquotes
MD028: false

# sometimes, you need HTML: <details>
MD033: false
MD013:
code_blocks: false
tables: false

# duplicate headers are sometimes useful
MD024: false
# Honestly most of the lint rules are absurd, we disable these *at least*

# can't split up a table row
MD013: false

# some titles end in 'etc.'
MD026: false

# gitbook provides its own top-level heading so we use `#` as `##`
# First line in a file should be a top-level heading
MD041: false
# Multiple top-level headings in the same document
MD025: false

# this is working around gitbook styling issues
MD029: false
# Inline HTML
MD033: false
# Multiple consecutive blank lines
MD012: false
2 changes: 1 addition & 1 deletion .github/workflows/cd.brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
bump-tap:
runs-on: ubuntu-latest
steps:
- uses: aurelien-baudet/workflow-dispatch@v2
- uses: aurelien-baudet/workflow-dispatch@v4
with:
workflow: bump.yml
repo: pkgxdev/homebrew-made
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/cd.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- uses: robinraju/release-downloader@v1.9
- uses: robinraju/release-downloader@v1.11
with:
releaseId: ${{ github.event.release.id }}

Expand All @@ -35,6 +35,8 @@ jobs:
mv linux+x86-64 products/x86_64
mv linux+aarch64 products/aarch64
curl -o products/pkgm https://pkgxdev.github.io/pkgm/pkgm.ts
- uses: actions/checkout@v4
with:
path: src
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cd.vx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ jobs:
- uses: fischerscode/tagger@v0
with:
prefix: v
- run: |
git tag -f latest
git push origin latest --force
2 changes: 1 addition & 1 deletion .github/workflows/cd.www.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- uses: robinraju/release-downloader@v1.9
- uses: robinraju/release-downloader@v1.11
with:
releaseId: ${{ github.event.release.id || github.event.inputs.release-id }}

Expand Down
49 changes: 29 additions & 20 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ concurrency:

jobs:
qa:
uses: ./.github/workflows/ci.yml

integration-tests:
uses: ./.github/workflows/ci.shellcode.yml
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features
env:
RUSTFLAGS: "-D warnings"

attach-srcs:
runs-on: ubuntu-latest
needs: [qa, integration-tests]
needs: qa
env:
FILENAME: pkgx-${{ github.event.inputs.version }}
steps:
Expand All @@ -30,8 +36,6 @@ jobs:
path: ${{ env.FILENAME }}
- name: clean
run: rm -rf ${{ env.FILENAME }}/.github .gitbook.yml
- name: stamp version.ts
run: echo "export default function() { return '${{github.event.inputs.version}}' }" > $FILENAME/src/modes/version.ts
- name: include GPG pubkey
run: echo "${{ secrets.GPG_PUBLIC_KEY }}" | base64 -d > $FILENAME/pkgx.dev.pub.asc
- run: tar cJf $FILENAME.tar.xz $FILENAME
Expand Down Expand Up @@ -77,32 +81,37 @@ jobs:
name: srcs

- uses: pkgxdev/setup@v2
with:
+: unzip xz

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

# we would prefer this, but our pkging is not stable enough :/
# - uses: pkgxdev/dev@v0
- uses: denoland/setup-deno@v2
with:
deno-version: ^2.1.4
- uses: dtolnay/rust-toolchain@stable

- run: deno task compile
# we don’t get why it’s only linux+aarch64 that lacks a linker either
# we use our own perl as the system perl does not have FindBin.pm
- run: |
if [ "${{ matrix.platform.build-id }}" = "linux+aarch64" ]; then
set -a
eval "$(pkgx +llvm.org +perl)"
AR=llvm-ar
set +a
fi
cargo build --release
mv target/release/pkgx .
strip ./pkgx
- uses: pkgxdev/brewkit/actions/setup-codesign@v0
- uses: pkgxdev/pantry/.github/actions/setup@main
if: startsWith(matrix.platform.build-id, 'darwin+')
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_P12 }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}
APPLE_IDENTITY: ${{ secrets.APPLE_IDENTITY }}

# codesign always fails for deno binaries, even though it
# signs fine. See https://github.com/denoland/deno/issues/575
- run: codesign
--sign "$APPLE_IDENTITY" --force
--preserve-metadata=entitlements,requirements,flags,runtime ./pkgx || true
--preserve-metadata=entitlements,requirements,flags,runtime ./pkgx
env:
APPLE_IDENTITY: ${{ secrets.APPLE_IDENTITY }}
if: startsWith(matrix.platform.build-id, 'darwin+')

- name: sanity check
run: test "$(./pkgx --version)" = "pkgx ${{ github.event.inputs.version }}"
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/ci.docker.yaml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/ci.docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: ci·docker

on:
pull_request:
paths:
- .github/Dockerfile
- .github/workflows/ci.docker.yml

concurrency:
group: ci/docker/${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: write

jobs:
docker-build:
runs-on: ubuntu-latest
container: debian:buster-slim
steps:
- uses: actions/checkout@v4

- run: apt-get update && apt-get install -y curl gcc perl make

- uses: dtolnay/rust-toolchain@stable
- run: cargo build --release

- uses: actions/upload-artifact@v4
with:
name: products
path: ./target/release/pkgx

docker-test:
runs-on: ubuntu-latest
needs: docker-build
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: products

- run: |
mkdir products
mv ./pkgx products/$(uname -m)
curl https://pkgxdev.github.io/pkgm/pkgm.ts -o products/pkgm
- run:
docker build
--tag pkgxdev/pkgx
--file .github/Dockerfile
.

- run: |
cat <<EoD> Dockerfile
FROM pkgxdev/pkgx
RUN pkgx --version
RUN if git --version; then exit 1; fi
RUN pkgx git --version
RUN pkgm install git
RUN if ! git --version; then exit 2; fi
EoD
docker build --file Dockerfile .
4 changes: 2 additions & 2 deletions .github/workflows/ci.md.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: ci·markdown-lint
name: ci·md

on:
pull_request:
paths:
- '**.md'
- 'docs/**.md'
- .github/workflows/ci.md.yml

concurrency:
Expand Down
Loading

0 comments on commit ea6da1e

Please sign in to comment.