Skip to content

Commit

Permalink
further testing ci
Browse files Browse the repository at this point in the history
  • Loading branch information
manforowicz committed Jun 7, 2024
1 parent 00c096d commit fab1f6f
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 5 deletions.
43 changes: 42 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,56 @@ jobs:
name: artifacts-dist-manifest
path: dist-manifest.json

publish-homebrew-formula:
needs:
- plan
- host
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN: ${{ needs.plan.outputs.val }}
GITHUB_USER: "axo bot"
GITHUB_EMAIL: "[email protected]"
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- uses: actions/checkout@v4
with:
repository: "manforowicz/homebrew-tap"
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
# So we have access to the formula
- name: Fetch homebrew formulae
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: Formula/
merge-multiple: true
# This is extra complex because you can make your Formula name not match your app name
# so we need to find releases with a *.rb file, and publish with that filename.
- name: Commit formula files
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_EMAIL}"
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
name=$(echo "$filename" | sed "s/\.rb$//")
version=$(echo "$release" | jq .app_version --raw-output)
git add "Formula/${filename}"
git commit -m "${name} ${version}"
done
git push
# Create a GitHub Release while uploading all files to it
announce:
needs:
- plan
- host
- publish-homebrew-formula
# use "always() && ..." to allow us to wait for all publish jobs while
# still allowing individual publish jobs to skip themselves (for prereleases).
# "host" however must run to completion, no skipping allowed!
if: ${{ always() && needs.host.result == 'success' }}
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
runs-on: "ubuntu-20.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Cargo Build & Test

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CARGO_TERM_COLOR: always
Expand Down
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ cargo-dist-version = "0.15.1"
# CI backends to support
ci = "github"
# The installers to generate for each app
installers = []
installers = ["homebrew"]
# A GitHub repo to push Homebrew formulas to
tap = "manforowicz/homebrew-tap"
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Publish jobs to run in CI
pr-run-mode = "upload"
# Whether to install an updater program
install-updater = false
publish-jobs = ["homebrew"]
# Publish jobs to run in CI
pr-run-mode = "plan"

# The profile that 'cargo dist' will build with
[profile.dist]
Expand Down
1 change: 1 addition & 0 deletions gday/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "gday"
version = "0.1.1"
description = "Command line tool to send files easily, securely, and directly, without a relay or port forwarding."
homepage = "https://github.com/manforowicz/gday/gday/"

# Inherit these keys from workspace toml
authors.workspace = true
Expand Down
1 change: 1 addition & 0 deletions gday_contact_exchange_protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "gday_contact_exchange_protocol"
version = "0.1.1"
description = "Protocol that peers can use to exchange their public and private socket addresses via a server."
homepage = "https://github.com/manforowicz/gday/gday_contact_exchange_protocol/"

# Inherit these keys from workspace toml
authors.workspace = true
Expand Down
1 change: 1 addition & 0 deletions gday_encryption/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "gday_encryption"
version = "0.1.1"
description = "A simple ChaCha20Poly1305 encryption wrapper around an IO stream."
homepage = "https://github.com/manforowicz/gday/gday_encryption/"

# Inherit these keys from workspace toml
authors.workspace = true
Expand Down
1 change: 1 addition & 0 deletions gday_file_transfer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "gday_file_transfer"
version = "0.1.1"
description = "A minimal protocol to securely transfer files over an IO stream. Used by gday."
homepage = "https://github.com/manforowicz/gday/gday_file_transfer/"

# Inherit these keys from workspace toml
authors.workspace = true
Expand Down
1 change: 1 addition & 0 deletions gday_hole_punch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "gday_hole_punch"
version = "0.1.1"
description = "Establish an authenticated peer-to-peer internet connection using TCP hole-punching."
homepage = "https://github.com/manforowicz/gday/gday_hole_punch/"

# Inherit these keys from workspace toml
authors.workspace = true
Expand Down
1 change: 1 addition & 0 deletions gday_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "gday_server"
version = "0.1.1"
description = "A server that lets 2 peers exchange their private and public addresses via the gday contact exchange protocol."
homepage = "https://github.com/manforowicz/gday/gday_server/"

# Inherit these keys from workspace toml
authors.workspace = true
Expand Down

0 comments on commit fab1f6f

Please sign in to comment.