Skip to content

Commit

Permalink
Merge dev -> master (#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl authored Apr 22, 2024
2 parents 220a570 + d87b0ac commit 3433f50
Show file tree
Hide file tree
Showing 133 changed files with 7,814 additions and 3,397 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/project-add.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Add issues and PRs to Sia project

on:
issues:
types:
- opened
pull_request:
types:
- opened

jobs:
add-to-project:
uses: SiaFoundation/workflows/.github/workflows/project-add.yml@master
secrets: inherit
74 changes: 54 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Publish

# Controls when the action will run.
# Controls when the action will run.
on:
# Triggers the workflow on new SemVer tags
push:
branches:
- master
- dev
tags:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-**'

Expand All @@ -28,7 +28,7 @@ jobs:
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
Expand Down Expand Up @@ -71,8 +71,8 @@ jobs:
matrix:
network: ["mainnet" , "zen"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Setup
Expand Down Expand Up @@ -116,14 +116,14 @@ jobs:
with:
name: renterd
path: release/
build-mac:
build-mac:
runs-on: macos-latest
strategy:
matrix:
network: ["mainnet" , "zen"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Setup Notarization
Expand Down Expand Up @@ -212,14 +212,14 @@ jobs:
with:
name: renterd
path: release/
build-windows:
build-windows:
runs-on: windows-latest
strategy:
matrix:
network: ["mainnet" , "zen"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Set build tag environment variable
Expand Down Expand Up @@ -253,28 +253,62 @@ jobs:
with:
name: renterd
path: release/
dispatch:

dispatch-homebrew: # only runs on full releases
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
needs: [docker, build-linux, build-mac, build-windows]
strategy:
matrix:
repo: ['siafoundation/homebrew-sia', 'siafoundation/linux']
runs-on: ubuntu-latest
steps:
- name: Extract Tag Name
id: get_tag
run: echo "::set-output name=tag_name::${GITHUB_REF#refs/tags/}"
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Repository Dispatch
- name: Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT_REPOSITORY_DISPATCH }}
repository: ${{ matrix.repo }}
repository: siafoundation/homebrew-sia
event-type: release-tagged
client-payload: >
{
"description": "Renterd: The Next-Gen Sia Renter",
"tag": "${{ steps.get_tag.outputs.tag_name }}",
"tag": "${{ env.tag_name }}",
"project": "renterd",
"workflow_id": "${{ github.run_id }}"
}
}
dispatch-linux: # run on full releases, release candidates, and master branch
if: startsWith(github.ref, 'refs/tags/v') || endsWith(github.ref, 'master')
needs: [docker, build-linux, build-mac, build-windows]
runs-on: ubuntu-latest
steps:
- name: Build Dispatch Payload
id: get_payload
uses: actions/github-script@v7
with:
script: |
const isRelease = context.ref.startsWith('refs/tags/v'),
isBeta = isRelease && context.ref.includes('-beta'),
tag = isRelease ? context.ref.replace('refs/tags/', '') : 'master';
let component = 'nightly';
if (isBeta) {
component = 'beta';
} else if (isRelease) {
component = 'main';
}
return {
description: "renterd: The Next-Gen Sia Renter",
tag: tag,
project: "renterd",
workflow_id: context.runId,
component: component
};
- name: Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT_REPOSITORY_DISPATCH }}
repository: siafoundation/linux
event-type: release-tagged
client-payload: ${{ steps.get_payload.outputs.result }}
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,10 @@ jobs:
- name: Configure Windows
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false # fixes go lint fmt error
- name: Configure MySQL
if: matrix.os == 'ubuntu-latest'
uses: mirromutth/[email protected]
with:
host port: 3800
mysql version: '8'
mysql root password: test
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Lint
Expand All @@ -43,6 +36,13 @@ jobs:
autopilot
bus bus/client
worker worker/client
- name: Configure MySQL
if: matrix.os == 'ubuntu-latest'
uses: mirromutth/[email protected]
with:
host port: 3800
mysql version: '8'
mysql root password: test
- name: Test
uses: n8maninger/action-golang-test@v1
with:
Expand Down
69 changes: 8 additions & 61 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,18 @@
name: Update UI
name: Update UI and open PR

on:
# Run daily
schedule:
- cron: '0 0 * * *'
repository_dispatch:
types: [update-ui]
# Enable manual trigger
workflow_dispatch:

jobs:
update-ui:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21.0'

- name: Check for new renterd tag in SiaFoundation/web
id: check-tag
env:
GH_TOKEN: ${{ github.token }}
run: |
# Fetch tags with pagination
TAGS_JSON=$(gh api --paginate repos/SiaFoundation/web/tags)
# Extract tags that start with "renterd/", sort them in version order, and pick the highest version
LATEST_RENTERD_GO_TAG=$(echo "$TAGS_JSON" | jq -r '.[] | select(.name | startswith("renterd/")).name' | sort -Vr | head -n 1)
LATEST_RENTERD_VERSION=$(echo "$LATEST_RENTERD_GO_TAG" | sed 's/renterd\///')
echo "Latest renterd tag is $LATEST_RENTERD_GO_TAG"
echo "GO_TAG=$LATEST_RENTERD_GO_TAG" >> $GITHUB_ENV
echo "VERSION=$LATEST_RENTERD_VERSION" >> $GITHUB_ENV
- name: Fetch release notes for the release
id: release-notes
env:
GH_TOKEN: ${{ github.token }}
if: env.GO_TAG != 'null'
run: |
RELEASE_TAG_FORMATTED=$(echo "$GO_TAG" | sed 's/\/v/@/')
RELEASES_JSON=$(gh api --paginate repos/SiaFoundation/web/releases)
RELEASE_NOTES=$(echo "$RELEASES_JSON" | jq -r --arg TAG_NAME "$RELEASE_TAG_FORMATTED" '.[] | select(.name == $TAG_NAME).body')
echo "Release notes for $RELEASE_TAG_FORMATTED: $RELEASE_NOTES"
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$RELEASE_NOTES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Update go.mod with latest module
if: env.GO_TAG != 'null'
run: |
GO_MODULE_FORMATTED=$(echo "$GO_TAG" | sed 's/\//@/')
echo "Updating go.mod to use $GO_MODULE_FORMATTED"
go clean -modcache
go get go.sia.tech/web/$GO_MODULE_FORMATTED
go mod tidy
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
if: env.GO_TAG != 'null'
- name: Update UI and open PR
uses: SiaFoundation/workflows/.github/actions/ui-update@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "ui: ${{ env.VERSION }}"
title: "ui: ${{ env.VERSION }}"
body: ${{ env.RELEASE_NOTES }}
branch: "ui/update"
delete-branch: true
moduleName: 'renterd'
goVersion: '1.21'
token: ${{ secrets.GITHUB_TOKEN }}
51 changes: 24 additions & 27 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ run:
# list of build tags, all linters use it. Default is empty list.
build-tags: []

# which dirs to skip: issues from them won't be reported;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but default dirs are skipped independently
# from this option's value (see skip-dirs-use-default).
skip-dirs:
- cover

# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true
Expand All @@ -36,9 +29,6 @@ run:

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true

Expand All @@ -61,23 +51,28 @@ linters-settings:
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
# By default list of stable checks is used.
enabled-checks:
- argOrder # Diagnostic options
- badCond
- caseOrder
- dupArg
- dupBranchBody
- dupCase
- dupSubExpr
- nilValReturn
- offBy1
- weakCond
- boolExprSimplify # Style options here and below.
- builtinShadow
- emptyFallthrough
- hexLiteral
- underef
- equalFold
enabled-tags:
- diagnostic
- style
disabled-checks:
# diagnostic
- commentedOutCode
- uncheckedInlineErr

# style
- exitAfterDefer
- ifElseChain
- importShadow
- octalLiteral
- paramTypeCombine
- ptrToRefParam
- stringsCompare
- tooManyResultsChecker
- typeDefFirst
- typeUnparen
- unlabelStmt
- unnamedResult
- whyNoLint
revive:
ignore-generated-header: true
rules:
Expand All @@ -102,6 +97,8 @@ linters:
- typecheck
- whitespace
- tagliatelle
- unused
- unparam

issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
Expand Down
Loading

0 comments on commit 3433f50

Please sign in to comment.