Version bump to 0.24 #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called 'build' | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Setups python environment | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
# Installs dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller | |
# Runs build.sh | |
- name: Run build script | |
run: ./build.sh | |
# Creates ZIP archives | |
- name: Create ZIP archives | |
run: | | |
mkdir -p dist/clipboard-sync-client dist/clipboard-sync-server | |
zip -r clipboard-sync-client.zip dist/clipboard-sync-client | |
zip -r clipboard-sync-server.zip dist/clipboard-sync-server | |
# Creates Github Release and uploads ZIPs | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: Automated release from the CI | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset Client | |
id: upload-release-asset-client | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./clipboard-sync-client.zip | |
asset_name: clipboard-sync-client.zip | |
asset_content_type: application/zip | |
- name: Upload Release Asset Server | |
id: upload-release-asset-server | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./clipboard-sync-server.zip | |
asset_name: clipboard-sync-server.zip | |
asset_content_type: application/zip | |
package-arch: | |
runs-on: ubuntu-latest | |
needs: build # Ensure this runs after the build job | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
path: 'repo' | |
- name: Build PKGBUILD | |
uses: docker://archlinux:latest | |
with: | |
entrypoint: /bin/bash | |
args: -c "pacman -Sy --noconfirm base-devel git xclip clipcat && chown -R nobody repo && cd repo/arch-packages/client && sudo -u nobody makepkg -s && cd ../server && sudo -u nobody makepkg -s" | |
- name: Find built server package | |
id: find-server-package | |
run: | | |
FILE_PATH=$(find ./repo/arch-packages/server -name '*.pkg.tar.zst') | |
echo "SERVER_PACKAGE_PATH=$FILE_PATH" >> $GITHUB_ENV | |
- name: Find built client package | |
id: find-client-package | |
run: | | |
FILE_PATH=$(find ./repo/arch-packages/client -name '*.pkg.tar.zst') | |
echo "CLIENT_PACKAGE_PATH=$FILE_PATH" >> $GITHUB_ENV | |
- name: Upload client package to Release | |
id: upload-client-package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.build.outputs.upload_url }} # Ensure this uses the output from the build job | |
asset_path: ${{ env.CLIENT_PACKAGE_PATH }} | |
asset_name: clipboard-sync-client.pkg.tar.zst | |
asset_content_type: application/zstd | |
- name: Upload server package to Release | |
id: upload-server-package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.build.outputs.upload_url }} # Ensure this uses the output from the build job | |
asset_path: ${{ env.SERVER_PACKAGE_PATH }} | |
asset_name: clipboard-sync-server.pkg.tar.zst | |
asset_content_type: application/zstd | |