mirror of
https://github.com/house-of-vanity/tmux-helper.git
synced 2026-02-04 01:37:57 +00:00
Added macos build
This commit is contained in:
100
.github/workflows/build.yml
vendored
100
.github/workflows/build.yml
vendored
@@ -1,60 +1,70 @@
|
|||||||
name: Build and publish
|
name: Build and publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# Sequence of patterns matched against refs/tags
|
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make_bin:
|
make_bin:
|
||||||
name: Build binary
|
name: Build binary
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
artifact_name: tmux-helper-linux
|
||||||
|
- os: macos-latest
|
||||||
|
artifact_name: tmux-helper-macos
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Pre-build
|
|
||||||
|
- name: Pre-build (Linux only)
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: sudo apt install -y libdbus-1-dev pkg-config libdbus-1-3 libfuse-dev
|
run: sudo apt install -y libdbus-1-dev pkg-config libdbus-1-3 libfuse-dev
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Build binary
|
- name: Build binary
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
- name: Upload binary
|
- name: Upload binary
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: tmux-helper
|
name: ${{ matrix.artifact_name }}
|
||||||
path: ./target/release/tmux-helper
|
path: ./target/release/tmux-helper
|
||||||
|
|
||||||
make_arch:
|
make_arch:
|
||||||
name: Make Arch Linux package
|
name: Make Arch Linux package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: archlinux
|
image: archlinux
|
||||||
options: --privileged
|
options: --privileged
|
||||||
volumes:
|
steps:
|
||||||
- /sys/fs/cgroup:/sys/fs/cgroup
|
- uses: actions/checkout@v2
|
||||||
steps:
|
- name: Build Arch Linux package
|
||||||
- uses: actions/checkout@v2
|
uses: FFY00/build-arch-package@master
|
||||||
- name: Build Arch Linux package
|
with:
|
||||||
uses: FFY00/build-arch-package@master
|
PKGBUILD: $GITHUB_WORKSPACE/.github/workflows/PKGBUILD
|
||||||
with:
|
OUTDIR: $HOME/arch-packages
|
||||||
PKGBUILD: $GITHUB_WORKSPACE/.github/workflows/PKGBUILD
|
- run: mv $HOME/arch-packages/*pkg.tar.zst tmux-helper-x86_64.pkg.tar.zst
|
||||||
OUTDIR: $HOME/arch-packages
|
- name: Upload Arch Package
|
||||||
- run: mv $HOME/arch-packages/*pkg.tar.zst tmux-helper-x86_64.pkg.tar.zst
|
uses: actions/upload-artifact@v2
|
||||||
- name: Upload Arch Package
|
with:
|
||||||
uses: actions/upload-artifact@v1
|
name: arch_linux_tmux-helper-x86_64.pkg.tar.zst
|
||||||
with:
|
path: ./tmux-helper-x86_64.pkg.tar.zst
|
||||||
name: arch_linux_tmux-helper-x86_64.pkg.tar.zst
|
|
||||||
path: ./tmux-helper-x86_64.pkg.tar.zst
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish release
|
name: Publish release
|
||||||
needs: [make_bin, make_arch]
|
needs: [make_bin, make_arch]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Get the version (git tag)
|
- name: Get version
|
||||||
id: get_version
|
id: get_version
|
||||||
run: |
|
run: |
|
||||||
echo ${GITHUB_REF/refs\/tags\/v/}
|
|
||||||
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
||||||
echo ::set-output name=FULL_TAG::${GITHUB_REF/refs\/tags\//}
|
echo ::set-output name=FULL_TAG::${GITHUB_REF/refs\/tags\//}
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
@@ -65,20 +75,32 @@ jobs:
|
|||||||
release_name: Release ${{ github.ref }}
|
release_name: Release ${{ github.ref }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
- name: Download binary
|
|
||||||
uses: actions/download-artifact@v1
|
- name: Download Linux binary
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: tmux-helper
|
name: tmux-helper-linux
|
||||||
path: ./
|
path: ./
|
||||||
- name: Download Arch Package
|
|
||||||
uses: actions/download-artifact@v1
|
- name: Download macOS binary
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: tmux-helper-macos
|
||||||
|
path: ./
|
||||||
|
|
||||||
|
- name: Download Arch package
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: arch_linux_tmux-helper-x86_64.pkg.tar.zst
|
name: arch_linux_tmux-helper-x86_64.pkg.tar.zst
|
||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
- name: Upload binary assets
|
- name: Upload binary assets
|
||||||
run: |
|
run: |
|
||||||
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
|
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
|
||||||
tar xjf linux-amd64-github-release.tar.bz2
|
tar xjf linux-amd64-github-release.tar.bz2
|
||||||
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
||||||
./bin/linux/amd64/github-release upload -u house-of-vanity -r tmux-helper --tag ${{ steps.get_version.outputs.FULL_TAG }} --name arch_linux_tmux-helper-${{ steps.get_version.outputs.VERSION }}-x86_64.pkg.tar.zst --file ./tmux-helper-x86_64.pkg.tar.zst
|
|
||||||
./bin/linux/amd64/github-release upload -u house-of-vanity -r tmux-helper --tag ${{ steps.get_version.outputs.FULL_TAG }} --name tmux-helper-${{ steps.get_version.outputs.VERSION }} --file ./tmux-helper
|
./bin/linux/amd64/github-release upload -u house-of-vanity -r tmux-helper --tag ${{ steps.get_version.outputs.FULL_TAG }} --name arch_linux_tmux-helper-${{ steps.get_version.outputs.VERSION }}-x86_64.pkg.tar.zst --file ./tmux-helper-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
|
./bin/linux/amd64/github-release
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user