Skip to content

Commit

Permalink
Upload packages from Cirrus CI to Github.
Browse files Browse the repository at this point in the history
  • Loading branch information
hipersayanX committed May 1, 2023
1 parent 096846c commit bcadd28
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 8 deletions.
18 changes: 13 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ mac_task:
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-base:latest
env:
UPLOAD: 0
UPLOAD: 1
env:
NJOBS: 4
GITHUB_TOKEN: ENCRYPTED[80867839ea1cae036c24d6491696b07aeee67dee7e558714d0031f84e338ec415d266fb19e482d7430826121cfe39d2c]
HOMEBREW_PATH: /opt/homebrew
NJOBS: 4
env:
only_if: ${CIRRUS_TAG} == ""
DAILY_BUILD: 1
env:
only_if: ${CIRRUS_TAG} != ""
DAILY_BUILD: 0
macos_instance:
cpu: 2
memory: 4G
Expand All @@ -26,9 +33,10 @@ mac_task:
deploy_script:
- chmod +x ports/ci/mac/deploy.sh
- ./ports/ci/mac/deploy.sh
binaries_artifacts:
#only_if: ${UPLOAD} == 1
path: "webcamoid-packages/mac/*"
upload_script:
only_if: ${UPLOAD} == 1
- chmod +x ports/ci/mac/upload.sh
- ./ports/ci/mac/upload.sh

freebsd_task:
env:
Expand Down
3 changes: 0 additions & 3 deletions ports/ci/mac/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ fi

brew update
brew upgrade
#brew link --overwrite numpy
brew install \
ccache \
cmake \
Expand All @@ -43,5 +42,3 @@ brew install \
python \
qt@5 \
vlc
# brew link --overwrite python
# brew link --force qt@5
46 changes: 46 additions & 0 deletions ports/ci/mac/upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Webcamoid, webcam capture application.
# Copyright (C) 2023 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
#
# Web-Site: http://webcamoid.github.io/

if [[ "$CIRRUS_RELEASE" == "" ]]; then
releaseName=daily-build
else
releaseName=$CIRRUS_RELEASE
fi

# if [[ "$GITHUB_TOKEN" == "" ]]; then
# echo "Please provide GitHub access token via GITHUB_TOKEN environment variable!"
# exit 1
# fi

file_content_type="application/octet-stream"
files_to_upload=$(find webcamoid-packages/mac -type f)

for fpath in $files_to_upload
do
echo "Uploading $fpath..."
name=$(basename "$fpath")
url_to_upload="https://uploads.github.com/repos/$CIRRUS_REPO_FULL_NAME/releases/$releaseName/assets?name=$name"
echo "To $url_to_upload"
# curl -X POST \
# --data-binary @$fpath \
# --header "Authorization: token $GITHUB_TOKEN" \
# --header "Content-Type: $file_content_type" \
# $url_to_upload
done

0 comments on commit bcadd28

Please sign in to comment.