Skip to content

Commit

Permalink
Merge branch 'master' into fix/bump-ipfs-cat-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel authored Sep 20, 2023
2 parents 784436a + f0f5e7f commit 481295f
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-ipfs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
- uses: ipfs/download-ipfs-distribution-action@v1
with:
name: go-ipfs
version: "${{ env.GO_IPFS_VER }}"
version: "${{ env.KUBO_VER }}"
- uses: ipfs/download-ipfs-distribution-action@v1
with:
name: ipfs-cluster-ctl
Expand Down
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
36 changes: 18 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ on:

env:
DIST_ROOT: ${{ github.event.inputs.custom_dist_root || '/ipns/dist.ipfs.tech' }} # content root used for calculating diff to build
GO_IPFS_VER: 'v0.15.0' # go-ipfs daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.4' # ipfs-cluster-ctl used for pinning
KUBO_VER: 'v0.21.0' # kubo daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.4' # ipfs-cluster-ctl used for pinning

jobs:
build:
runs-on: ${{ fromJSON(vars.CI_BUILD_RUNS_ON || '"ubuntu-latest"') }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- env:
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Inspect git status and contents of ./releases
run: git status && ls -Rhl ./releases
- name: Temporarily save ./releases artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: releases-unsigned-diff
path: releases
Expand All @@ -46,8 +46,8 @@ jobs:
lint:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm ci --no-audit --progress=false
Expand All @@ -57,9 +57,9 @@ jobs:
runs-on: "macos-latest"
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Retrieve unsigned artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: releases-unsigned-diff
path: releases
Expand All @@ -72,7 +72,7 @@ jobs:
brew install ipfs coreutils gawk gnu-sed jq mitchellh/gon/gon
ipfs init --profile test # needed for calculating NEW_CID later
- name: Import Keychain Certs
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071 # v1@2020-02-03
uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2
with:
p12-file-base64: ${{ secrets.APPLE_CERTS_P12 }}
p12-password: ${{ secrets.APPLE_CERTS_PASS }}
Expand All @@ -87,7 +87,7 @@ jobs:
- name: List ./releases after
run: ls -Rhl ./releases || echo "No ./releases"
- name: Temporarily save notarized artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: releases-signed-macos-diff
path: releases
Expand All @@ -100,12 +100,12 @@ jobs:
environment: Deploy
steps:
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Retrieve signed artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
continue-on-error: true # skip if no releases
with:
name: releases-signed-macos-diff
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: ./dockerized make diff
if: github.event_name == 'pull_request'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: github.event_name == 'pull_request'
with:
name: diff
Expand All @@ -161,16 +161,16 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: diff
- name: Create comment with the diff
uses: actions/github-script@v4
uses: actions/github-script@v6
with:
script: |
const fs = require('fs').promises
const diff = await fs.readFile('diff', 'utf8')
await github.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.number }},
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:

env:
DIST_ROOT: ${{ github.event.inputs.custom_dist_root || '/ipns/dist.ipfs.tech' }} # content root used for calculating diff to build
GO_IPFS_VER: 'v0.15.0' # go-ipfs daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.4' # ipfs-cluster-ctl used for pinning
KUBO_VER: 'v0.21.0' # kubo daemon used for chunking and applying diff
CLUSTER_CTL_VER: 'v1.0.4' # ipfs-cluster-ctl used for pinning

concurrency:
group: nightly
Expand All @@ -23,7 +23,7 @@ jobs:
prepare-matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: awk 'NR == FNR {f1[$0] = 1; next}; !($0 in f1)' ignored-during-nightly <(ls ./dists -1) > nightlies-to-run
- id: set-matrix
run: echo "::set-output name=matrix::$(jq -nc '$ARGS.positional' --args $(cat nightlies-to-run))"
Expand All @@ -38,7 +38,7 @@ jobs:
matrix:
dist_name: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- env:
CLUSTER_USER: ${{ secrets.CLUSTER_USER }}
CLUSTER_PASSWORD: ${{ secrets.CLUSTER_PASSWORD }}
Expand All @@ -47,20 +47,20 @@ jobs:
- run: cd ./dists/${{ matrix.dist_name }} && make nightly
- run: ./dockerized make publish
- name: Create issue if build failed
uses: actions/github-script@v4
uses: actions/github-script@v6
if: ${{ failure() }}
with:
script: |
const title = 'Nightly build failed for ${{ matrix.dist_name }}'
const body = '${{ matrix.dist_name }} failed to build from the latest commit: https://github.com/ipfs/distributions/actions/runs/${{ github.run_id }}'
const opts = { owner: context.repo.owner, repo: context.repo.repo }
const response = await github.search.issuesAndPullRequests({
const response = await github.rest.search.issuesAndPullRequests({
q: `repo:ipfs/distributions is:issue is:open in:title ${title}`
})
console.log('github.issuesAndPullRequests', response)
let link
if (response.data.items.length === 0) {
const created = await github.issues.create({ ...opts, title, body,
const created = await github.rest.issues.create({ ...opts, title, body,
labels: ['kind/bug', 'need/triage']
})
console.log('no open issues, created a new one', created)
Expand All @@ -69,7 +69,7 @@ jobs:
for (const issue of response.data.items) {
if (issue.title !== title) continue
console.log('found existing open issue', issue)
const created = await github.issues.createComment({ ...opts,
const created = await github.rest.issues.createComment({ ...opts,
issue_number: issue.number,
body
})
Expand Down Expand Up @@ -98,25 +98,25 @@ jobs:
GIT_REVISION: ${{ github.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Close any open issues about broken build
uses: actions/github-script@v4
uses: actions/github-script@v6
if: ${{ success() }}
with:
script: |
const title = 'Nightly build failed for ${{ matrix.dist_name }}'
const body = 'Fixed! ${{ matrix.dist_name }} got successfully built from the latest commit: https://github.com/ipfs/distributions/actions/runs/${{ github.run_id }}'
const opts = { owner: context.repo.owner, repo: context.repo.repo }
const response = await github.search.issuesAndPullRequests({
const response = await github.rest.search.issuesAndPullRequests({
q: `repo:ipfs/distributions is:issue is:open in:title ${title}`
})
console.log('github.issuesAndPullRequests', response)
for (const issue of response.data.items) {
if (issue.title !== title) continue
console.log('found existing open issue', issue)
const created = await github.issues.createComment({ ...opts,
const created = await github.rest.issues.createComment({ ...opts,
issue_number: issue.number,
body
})
await github.issues.update({ ...opts,
await github.rest.issues.update({ ...opts,
issue_number: issue.number,
state: 'closed',
assignees: []
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,12 @@ name: Close and mark stale issue

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * *'

permissions:
issues: write
pull-requests: write

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-issue-label: 'kind/stale'
any-of-labels: 'need/author-input'
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
days-before-issue-stale: 6
days-before-issue-close: 7
enable-statistics: true
uses: pl-strflt/.github/.github/workflows/[email protected]
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 16.15.1
golang 1.19.8
golang 1.20.7
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
ARG USER_UID

ARG GO_IPFS_VER
ARG KUBO_VER
RUN apt-get update -q && apt-get install -y git curl gnupg jq build-essential gawk zip tzdata && \
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata
RUN curl --retry 5 \
"https://dist.ipfs.tech/go-ipfs/${GO_IPFS_VER}/go-ipfs_${GO_IPFS_VER}_linux-amd64.tar.gz" -o /tmp/ipfs.tar.gz && \
tar vzx -f /tmp/ipfs.tar.gz -C /usr/local/bin/ go-ipfs/ipfs --strip-components=1

RUN curl -sS --retry 5 \
"https://dist.ipfs.tech/kubo/${KUBO_VER}/kubo_${KUBO_VER}_linux-amd64.tar.gz" -o /tmp/kubo.tar.gz && \
tar vzx -f /tmp/kubo.tar.gz -C /usr/local/bin/ kubo/ipfs --strip-components=1

RUN adduser --shell /bin/bash --home /asdf --disabled-password --gecos asdf asdf --uid $USER_UID
ENV PATH="${PATH}:/asdf/.asdf/shims:/asdf/.asdf/bin"
Expand Down
5 changes: 5 additions & 0 deletions dists/fs-repo-14-to-15/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repo = github.com/ipfs/fs-repo-migrations
# sub-package to build (omit when building the main package)
package = fs-repo-14-to-15

include ../../common.mk
15 changes: 15 additions & 0 deletions dists/fs-repo-14-to-15/build_matrix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
darwin amd64
darwin arm64
freebsd 386
freebsd amd64
freebsd arm
openbsd 386
openbsd amd64
openbsd arm
linux 386
linux amd64
linux arm
linux arm64
windows 386
windows amd64
windows arm64
1 change: 1 addition & 0 deletions dists/fs-repo-14-to-15/current
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.0.1
1 change: 1 addition & 0 deletions dists/fs-repo-14-to-15/description
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Migrate fsrepo from version 14 to version 15
Empty file added dists/fs-repo-14-to-15/no-site
Empty file.
1 change: 1 addition & 0 deletions dists/fs-repo-14-to-15/repo-owner
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ipfs
2 changes: 2 additions & 0 deletions dists/fs-repo-14-to-15/versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
v1.0.0
v1.0.1
1 change: 1 addition & 0 deletions dists/fs-repo-14-to-15/vtag
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fs-repo-14-to-15
1 change: 1 addition & 0 deletions dists/go-ipfs/build_matrix
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ linux arm
linux arm64
windows 386
windows amd64
windows arm64
2 changes: 1 addition & 1 deletion dists/go-ipfs/current
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.20.0
v0.22.0
7 changes: 7 additions & 0 deletions dists/go-ipfs/versions
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,10 @@ v0.20.0-rc1
v0.20.0-rc2
v0.19.2
v0.20.0
v0.21.0-rc1
v0.21.0-rc2
v0.21.0-rc3
v0.21.0
v0.21.1
v0.22.0-rc1
v0.22.0
2 changes: 1 addition & 1 deletion dists/kubo/current
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.20.0
v0.22.0
7 changes: 7 additions & 0 deletions dists/kubo/versions
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ v0.20.0-rc1
v0.20.0-rc2
v0.19.2
v0.20.0
v0.21.0-rc1
v0.21.0-rc2
v0.21.0-rc3
v0.21.0
v0.21.1
v0.22.0-rc1
v0.22.0
2 changes: 1 addition & 1 deletion dockerized
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ "$(docker images -q "$IMAGE_NAME:$IMAGE_TAG" 2> /dev/null)" == "" ]]; then
docker build . -t "$IMAGE_NAME:$IMAGE_TAG" \
--build-arg CACHEBUST="$IMAGE_TAG" \
--build-arg USER_UID="$(id -u "$USER")" \
--build-arg GO_IPFS_VER="${GO_IPFS_VER:-$(curl -s https://dist.ipfs.tech/go-ipfs/versions | tail -n 1)}" # match http api client version on CI
--build-arg KUBO_VER="${KUBO_VER:-$(curl -s https://dist.ipfs.tech/kubo/versions | tail -n 1)}" # match http api client version on CI

fi

Expand Down
5 changes: 4 additions & 1 deletion site/assets/js/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const platform = require('platform')

function getArch (os, arch) {
if (arch === '32' && os !== 'darwin') return '386'
if (os === 'darwin') {
return 'arm64' // assume Apple ARM https://github.com/ipfs/distributions/issues/840
}
return 'amd64'
}

Expand Down Expand Up @@ -37,7 +40,7 @@ module.exports = function handlePlatform () {
let osName = getOsName(platform.os.family)
let arch = getArch(osName, platform.os.architecture)

if (arch === 'amd64') {
if (arch === 'amd64' || arch === 'arm64') {
arch = '64bit'
} else {
arch = '32bit'
Expand Down

0 comments on commit 481295f

Please sign in to comment.