Skip to content

Commit

Permalink
Merge branch 'dev' into chris/contractor-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Apr 3, 2024
2 parents 4b31b83 + 45c682d commit 8042a4a
Show file tree
Hide file tree
Showing 74 changed files with 2,535 additions and 1,537 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/project-add.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,5 @@ on:

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
# You can target a project in a different organization
# to the issue
project-url: https://github.com/orgs/SiaFoundation/projects/5
github-token: ${{ secrets.PAT_ADD_TO_PROJECT }}
uses: SiaFoundation/workflows/.github/workflows/project-add.yml@master
secrets: inherit
76 changes: 55 additions & 21 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 @@ -112,18 +112,18 @@ jobs:
go build -tags="$BUILD_TAGS" -trimpath -o bin/ -a -ldflags '-s -w -linkmode external -extldflags "-static"' ./cmd/renterd
cp README.md LICENSE bin/
zip -qj $ZIP_OUTPUT bin/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
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 @@ -208,18 +208,18 @@ jobs:
/usr/bin/codesign --deep -f -v --timestamp -o runtime,library -s $APPLE_CERT_ID bin/renterd
ditto -ck bin $ZIP_OUTPUT
xcrun notarytool submit -k ~/private_keys/AuthKey_$APPLE_API_KEY.p8 -d $APPLE_API_KEY -i $APPLE_API_ISSUER --wait --timeout 10m $ZIP_OUTPUT
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
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 @@ -249,32 +249,66 @@ jobs:
azuresigntool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v bin/renterd.exe
cp README.md LICENSE bin/
7z a $ZIP_OUTPUT bin/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
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 "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": "${{ 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 }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false # fixes go lint fmt error
- 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 Down
64 changes: 6 additions & 58 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update UI
name: Update UI and open PR

on:
# Run daily
Expand All @@ -11,61 +11,9 @@ 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 }}
Loading

0 comments on commit 8042a4a

Please sign in to comment.