Skip to content

Commit

Permalink
Merge pull request #344 from SiaFoundation/nate/update-release-dispatch
Browse files Browse the repository at this point in the history
Update dispatch to build master
  • Loading branch information
ChrisSchinnerl authored Mar 26, 2024
2 parents a6f31f4 + f645b52 commit 37d4583
Showing 1 changed file with 46 additions and 13 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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
tags:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-**'

Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
with:
name: hostd
path: release/
build-mac:
build-mac:
runs-on: macos-latest
needs: [ test ]
steps:
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
with:
name: hostd
path: release/
build-windows:
build-windows:
runs-on: windows-latest
needs: [ test ]
steps:
Expand Down Expand Up @@ -213,28 +213,61 @@ jobs:
with:
name: hostd
path: release/
dispatch:
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')

dispatch-homebrew: # only runs on full releases
if: startsWith(github.ref, 'refs/tags/v')
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/}"

- 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": "Hostd: A host for Sia",
"description": "hostd: The Next-Gen Sia Host",
"tag": "${{ steps.get_tag.outputs.tag_name }}",
"project": "hostd",
"workflow_id": "${{ github.run_id }}"
}
}
dispatch-linux: # always runs
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: "hostd: The Next-Gen Sia Host",
tag: tag,
project: "hostd",
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 }}

0 comments on commit 37d4583

Please sign in to comment.