Skip to content

Commit

Permalink
Build Mac artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
null-dev committed Apr 5, 2021
1 parent 465996d commit 4ae9784
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 5 deletions.
48 changes: 43 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
x86_64-unknown-linux-gnu,
]
steps:
- name: Install gcc-multilib and 32-bit openssl
- name: Install 32-bit libraries
if: matrix.target == 'i686-unknown-linux-gnu'
run: |
sudo dpkg --add-architecture i386
Expand Down Expand Up @@ -90,6 +90,37 @@ jobs:
retention-days: 5
path: |
target/wix
build-mac:
runs-on: macos-latest
strategy:
matrix:
target: [
aarch64-apple-darwin,
x86_64-apple-darwin,
]
steps:
- name: Setup rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
default: true
- uses: actions/checkout@v2
- name: Build Mac binary
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose
- name: Rename binaries
run: mv target/release/firefox_profile_switcher_connector target/release/mac-${{ matrix.target }}
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: mac-artifacts
retention-days: 5
path: |
target/release/mac-${{ matrix.target }}
manifest/manifest-mac.json
release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
Expand All @@ -114,10 +145,15 @@ jobs:
find . -mindepth 2 -type f -exec mv -t . -n '{}' + # Flatten directory
rename -E 's/^firefox_profile_switcher_connector-.+?-(.+msi)$/windows-$1/' *.msi
popd
rename -E 's/amd64/x86_64/' linux-artifacts/* windows-artifacts/*
rename -E 's/x86_64/x64/' linux-artifacts/* windows-artifacts/*
rename -E 's/i386/i686/' linux-artifacts/* windows-artifacts/*
rename -E 's/i686/x86/' linux-artifacts/* windows-artifacts/*
pushd mac-artifacts
find . -mindepth 2 -type f -exec mv -t . -n '{}' + # Flatten directory
rename -E 's/^mac-(.+?)-apple-darwin$/mac-$1/' mac-*
mv manifest-mac.json mac-manifest.json
popd
rename -E 's/amd64/x86_64/' linux-artifacts/* windows-artifacts/* mac-artifacts/*
rename -E 's/x86_64/x64/' linux-artifacts/* windows-artifacts/* mac-artifacts/*
rename -E 's/i386/i686/' linux-artifacts/* windows-artifacts/* mac-artifacts/*
rename -E 's/i686/x86/' linux-artifacts/* windows-artifacts/* mac-artifacts/*
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
Expand All @@ -126,6 +162,7 @@ jobs:
path: |
linux-artifacts
windows-artifacts
mac-artifacts
- name: Changelog
id: Changelog
uses: metcalfc/[email protected]
Expand All @@ -144,5 +181,6 @@ jobs:
linux-artifacts/*.deb
linux-artifacts/*.rpm
windows-artifacts/*.msi
mac-artifacts/mac-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ firefox_profile_switcher_connector = { path = "/usr/bin/ff-pswitch-connector" }

[package.metadata.rpm.files]
"manifest-linux.json" = { path = "/usr/lib/mozilla/native-messaging-hosts/ax.nd.profile_switcher_ff.json" }

# TODO Strip once https://github.com/rust-lang/rust/issues/72110 is on stable
9 changes: 9 additions & 0 deletions manifest/manifest-mac.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"allowed_extensions": [
"[email protected]"
],
"description": "Profile Switcher for Firefox",
"name": "ax.nd.profile_switcher_ff",
"path": "/usr/local/bin/ff-pswitch-connector",
"type": "stdio"
}

0 comments on commit 4ae9784

Please sign in to comment.