Skip to content

Commit 27de554

Browse files
committed
update installer for v1 (#176)
The action remains v0 for now. We need the pantry to understand pre-releases or to wait for v1 proper.
1 parent 55f603b commit 27de554

24 files changed

+422
-1124
lines changed

.github/CI_FAILURE_ISSUE_TEMPLATE.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "npm"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/smoke-test.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/cd.yml

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,22 @@
11
on:
2-
push:
3-
branches:
4-
- main
52
workflow_dispatch:
6-
7-
permissions:
8-
contents: read
3+
inputs:
4+
version:
5+
required: true
96

107
jobs:
11-
# check if this is a new release
12-
smoke:
13-
runs-on: ubuntu-latest
14-
outputs:
15-
version: ${{ steps.tea.outputs.version }}
16-
steps:
17-
- uses: actions/checkout@v3
18-
- uses: ./
19-
id: tea
20-
21-
- id: rev-parse
22-
name: did we already publish this version?
23-
run: |
24-
# fetch tags since actions/checkout is a shallow checkout
25-
git fetch --prune --unshallow --tags
26-
27-
if git show-ref --tags v${{ steps.tea.outputs.version }} --quiet; then
28-
echo "::set-output name=result::cancel"
29-
fi
30-
31-
- uses: andymckay/[email protected]
32-
if: ${{ steps.rev-parse.outputs.result == 'cancel' }}
33-
34-
ci:
35-
needs: [smoke]
8+
qa1:
369
uses: ./.github/workflows/ci.yml
37-
secrets: inherit
38-
39-
ci-pre-reqs:
40-
needs: [smoke]
41-
uses: ./.github/workflows/ci-pre-reqs.yml
42-
secrets: inherit
10+
qa2:
11+
uses: ./.github/workflows/ci.installer.yml
12+
qa3:
13+
uses: ./.github/workflows/ci.action.yml
4314

4415
put:
4516
permissions:
4617
contents: write
4718
deployments: write
48-
needs: [ci, ci-pre-reqs, smoke]
19+
needs: [qa1, qa2, qa3]
4920
runs-on: ubuntu-latest
5021
steps:
5122
- name: Create Deployment
@@ -63,30 +34,30 @@ jobs:
6334
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6435
aws-region: us-east-1
6536

66-
- run: |
67-
aws s3 cp \
68-
./install.sh s3://www.tea.xyz/pour.sh \
69-
--metadata-directive REPLACE \
37+
- run:
38+
aws s3 cp
39+
./installer.sh s3://www.tea.xyz/pour.sh
40+
--metadata-directive REPLACE
7041
--cache-control no-cache,must-revalidate
71-
- run: |
72-
aws cloudfront create-invalidation \
73-
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} \
42+
- run:
43+
aws cloudfront create-invalidation
44+
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }}
7445
--paths / /pour.sh
7546

7647
- run: |
77-
git tag v${{ needs.smoke.outputs.version }}
78-
git push origin v${{ needs.smoke.outputs.version }}
48+
git tag v${{ github.event.inputs.version }}
49+
git push origin v${{ github.event.inputs.version }}
7950
8051
- uses: softprops/action-gh-release@v1
8152
with:
82-
files: ./install.sh
83-
tag_name: v${{ needs.smoke.outputs.version }}
53+
files: ./installer.sh
54+
tag_name: v${{ github.event.inputs.version }}
8455
fail_on_unmatched_files: true
8556

8657
- uses: fischerscode/tagger@v0
8758
with:
8859
prefix: v
89-
tag: v${{ needs.smoke.outputs.version }}
60+
tag: v${{ github.event.inputs.version }}
9061

9162
- name: Seal Deployment
9263
uses: bobheadxi/deployments@v1

.github/workflows/ci-pre-reqs.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/ci.action.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
on:
2+
workflow_call:
3+
pull_request:
4+
paths:
5+
- action.ts
6+
- action.yml
7+
- package.json
8+
9+
concurrency:
10+
group: ${{ github.ref || 'ci' }}/action.ts
11+
cancel-in-progress: true
12+
13+
jobs:
14+
check-dist-was-run:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- run: curl -Ssf https://tea.xyz/$(uname)/$(uname -m).tgz | sudo tar xz -C /usr/local/bin
19+
- run: ./scripts/dist.sh
20+
- run: git diff --exit-code
21+
22+
gha:
23+
needs: check-dist-was-run
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
os:
29+
- macos-latest
30+
- ubuntu-latest
31+
- [self-hosted, macOS, ARM64] # we need to be sure the action
32+
- [self-hosted, linux, ARM64] # works in arm64 environments
33+
prefix:
34+
- null
35+
- /opt
36+
container:
37+
- null
38+
include:
39+
- os: ubuntu-latest
40+
container: debian:buster-slim
41+
srcroot: .
42+
- os: ubuntu-latest
43+
container: debian:buster-slim
44+
srcroot: null
45+
container: ${{ matrix.container }}
46+
steps:
47+
- uses: actions/checkout@v3
48+
49+
- uses: ./
50+
id: tea
51+
with:
52+
prefix: ${{ matrix.prefix }}
53+
srcroot: ${{ matrix.srcroot || github.workspace }}
54+
55+
- run: test -n "$VERSION"
56+
- run: test -n "${{ steps.tea.outputs.version }}"
57+
- run: test v$VERSION = v${{ steps.tea.outputs.version }}
58+
- run: tea --env
59+
- run: which tea
60+
- run: node --eval 'console.log(1)'
61+
62+
chaste:
63+
needs: check-dist-was-run
64+
runs-on: ubuntu-latest
65+
container: debian:buster-slim
66+
steps:
67+
- uses: actions/checkout@v3
68+
- uses: ./
69+
with:
70+
chaste: true
71+
- run:
72+
if node --version; then
73+
exit 1;
74+
fi
75+
76+
additional-pkgs:
77+
needs: check-dist-was-run
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v3
81+
- uses: ./
82+
with:
83+
+deno.land: ^1.30
84+
# ^^ produces a warning, but we like this syntax
85+
# we're hoping GH allows us to suppress this warning in the future
86+
# discussion: https://github.com/octokit/request-action/issues/26
87+
- run: deno --version
88+
89+
additional-pkgs-2:
90+
needs: check-dist-was-run
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v3
94+
- uses: ./
95+
with:
96+
+: |
97+
deno.land^1.30
98+
cli.github.com
99+
- run: deno --version
100+
- run: gh --version

.github/workflows/ci.installer.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
on:
2+
workflow_call:
3+
pull_request:
4+
paths:
5+
- installer.sh
6+
- .github/workflows/ci.installer.yml
7+
8+
concurrency:
9+
group: ${{ github.ref || 'ci' }}/installer.sh
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
install-tea:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os:
21+
- macos-latest
22+
- ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
# using cat | sh to emulate the curl command we tell people to use
26+
- run: cat ./installer.sh | sh
27+
- run: tea --version
28+
29+
usage-as-proxy:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
- run: cat ./installer.sh | sh -s node --eval 'console.log(1)'
34+
- run: ./installer.sh sh -c "which tea"
35+
- run: source <(cat ./installer.sh) duf
36+
- run: if command -v tea; then exit 1; fi
37+
38+
sudo-not-required:
39+
runs-on: ubuntu-latest
40+
container: debian:buster-slim
41+
steps:
42+
- uses: actions/checkout@v3
43+
- run: ./installer.sh
44+
env:
45+
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin
46+
47+
eval-bash:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- run: |
52+
eval "$(cat ./installer.sh)"
53+
tea +duf
54+
duf --version
55+
56+
test -n "$BASH_VERSION"
57+
test -z "$ZSH_VERSION"
58+
shell: bash -e {0}
59+
60+
# check tea was installed despite executing via `eval`
61+
- run:
62+
tea duf --version
63+
64+
eval-zsh:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: prep
68+
run: sudo apt-get update && sudo apt-get install -y zsh
69+
70+
- uses: actions/checkout@v3
71+
- run: |
72+
eval "$(cat ./installer.sh)"
73+
tea +duf
74+
duf --version
75+
76+
test -n "$ZSH_VERSION"
77+
test -z "$BASH_VERSION"
78+
shell: zsh -e {0}
79+
80+
eval-posix-sh:
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v3
84+
- run: |
85+
eval "$(cat ./installer.sh)"
86+
tea +duf
87+
duf --version
88+
89+
test -z "$ZSH_VERSION"
90+
test -z "$BASH_VERSION"
91+
shell: /bin/sh -e {0}
92+
93+
sudo-required:
94+
runs-on: ubuntu-latest
95+
steps:
96+
- uses: actions/checkout@v3
97+
- run: sudo chmod go-w /usr/local/bin
98+
# ^^ we run as `runner` but this dir has 999 perms
99+
- run: ./installer.sh
100+
- run: test "$(which tea)" = /usr/local/bin/tea
101+
102+
no-dirs:
103+
strategy:
104+
matrix:
105+
dir: [/usr/local, /usr/local/bin]
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v3
109+
- run: sudo mv ${{ matrix.dir }} $(mktemp -d)
110+
- run: ./installer.sh
111+
- run: tea duf --version

0 commit comments

Comments
 (0)