mirror of
https://github.com/house-of-vanity/tmux-helper.git
synced 2026-02-04 01:37:57 +00:00
Drop PKGBUILD action
This commit is contained in:
137
.github/workflows/build.yml
vendored
137
.github/workflows/build.yml
vendored
@@ -5,23 +5,25 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
BINARY_NAME: tmux-helper
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make_bin:
|
build:
|
||||||
name: Build binary
|
name: Build binaries
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest]
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
artifact_name: tmux-helper-linux
|
platform_name: linux-amd64
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
artifact_name: tmux-helper-macos
|
platform_name: macos-arm64
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Pre-build (Linux only)
|
- name: Pre-build (Linux)
|
||||||
if: matrix.os == 'ubuntu-latest'
|
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
|
||||||
|
|
||||||
@@ -32,87 +34,62 @@ jobs:
|
|||||||
- name: Build binary
|
- name: Build binary
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
- name: Upload binary
|
- name: Rename binary
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.artifact_name }}
|
|
||||||
path: ./target/release/tmux-helper
|
|
||||||
|
|
||||||
# make_arch:
|
|
||||||
# name: Make Arch Linux package
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# container:
|
|
||||||
# image: archlinux
|
|
||||||
# options: --privileged
|
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v2
|
|
||||||
# - name: Disable systemd-nspawn
|
|
||||||
# run: echo 'BUILDENV+=(!use_nspawn)' >> /etc/makepkg.conf
|
|
||||||
# - name: Build Arch Linux package
|
|
||||||
# uses: FFY00/build-arch-package@v1
|
|
||||||
# with:
|
|
||||||
# PKGBUILD: $GITHUB_WORKSPACE/.github/workflows/PKGBUILD
|
|
||||||
# OUTDIR: $HOME/arch-packages
|
|
||||||
# - run: mv $HOME/arch-packages/*pkg.tar.zst tmux-helper-x86_64.pkg.tar.zst
|
|
||||||
# - name: Upload Arch Package
|
|
||||||
# uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: arch_linux_tmux-helper-x86_64.pkg.tar.zst
|
|
||||||
# path: ./tmux-helper-x86_64.pkg.tar.zst
|
|
||||||
|
|
||||||
publish:
|
|
||||||
name: Publish release
|
|
||||||
needs: make_bin
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Get version
|
|
||||||
id: get_version
|
|
||||||
run: |
|
run: |
|
||||||
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
mkdir -p ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
echo ::set-output name=FULL_TAG::${GITHUB_REF/refs\/tags\//}
|
cp target/release/${{ env.BINARY_NAME }} ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}/${{ env.BINARY_NAME }}
|
||||||
|
|
||||||
- name: Create Release
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
|
path: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Create Release Page
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
outputs:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: ncipollo/release-action@v1
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
allowUpdates: true
|
||||||
release_name: Release ${{ github.ref }}
|
tag: ${{ github.ref_name }}
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
- name: Download Linux binary
|
upload:
|
||||||
uses: actions/download-artifact@v4
|
name: Upload Release Assets
|
||||||
|
needs: release
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform_name: linux-amd64
|
||||||
|
- os: macos-latest
|
||||||
|
platform_name: macos-arm64
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
name: Download ${{ matrix.platform_name }} artifact
|
||||||
with:
|
with:
|
||||||
name: tmux-helper-linux
|
name: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
path: ./
|
path: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
|
|
||||||
- name: Download macOS binary
|
- name: Upload Release Asset
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
name: tmux-helper-macos
|
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
path: ./
|
asset_path: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}/${{ env.BINARY_NAME }}
|
||||||
- name: Upload binary assets
|
asset_name: ${{ env.BINARY_NAME }}_${{ matrix.platform_name }}
|
||||||
run: |
|
asset_content_type: application/octet-stream
|
||||||
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
|
|
||||||
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 tmux-helper-${{ steps.get_version.outputs.VERSION }}-linux \
|
|
||||||
--file ./tmux-helper
|
|
||||||
|
|
||||||
mv ./tmux-helper ./tmux-helper-macos
|
|
||||||
|
|
||||||
./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 }}-macos \
|
|
||||||
--file ./tmux-helper-macos
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user