Skip to content

Commit

Permalink
Add ci/cd workflow (#5)
Browse files Browse the repository at this point in the history
* build: Keep track of Cargo.lock

* build: Add `visionossim` target to `all` deps

* ci: Add ci workflow

* ci: Use the correct file path in the upload step

* ci: Compute sha checksum

* build: add missing dependencies to the `all` phony target

* test the make manifest target

* mkdir .build

* ci: push to test

* ci: checkout with fetch-depth 0

* ci: force push

* ci: log remote

* ci: manual trigger

* ci: redo ci with a manual trigger

* revert Makefile changes
  • Loading branch information
unclekingpin authored Sep 2, 2024
1 parent 1e7d858 commit 27fec76
Show file tree
Hide file tree
Showing 3 changed files with 1,926 additions and 1 deletion.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Version"
required: true

jobs:
Release:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git config
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Set default rust toolchain
run: rustup default nightly
- name: Install rustfmt
run: rustup component add rustfmt
- name: Install clippy
run: rustup component add clippy
- name: Add x86_64-apple-ios target
run: rustup target add x86_64-apple-ios
- name: Add aarch64-apple-ios target
run: rustup target add aarch64-apple-ios
- name: Add aarch64-apple-ios-sim target
run: rustup target add aarch64-apple-ios-sim
- name: Install rust-src
run: rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
- name: Install cargo lipo
run: cargo install cargo-lipo
- name: Install cbindgen
run: brew install cbindgen
- name: Install protobuf
run: brew install protobuf
- name: Install swift-protobuf
run: brew install swift-protobuf
- name: Setup Xcode
run: sudo xcode-select -switch /Applications/Xcode_15.4.app
- name: Build stremio-core-swift
run: make all
- name: Archive StremioCore.xcframework
run: cd .build && zip -r StremioCore.xcframework.zip ./StremioCore.xcframework
- name: Compute sha checksum of StremioCore.xcframework.zip
run: cd .build && shasum -a 256 StremioCore.xcframework.zip > StremioCore.xcframework.zip.sha256
- name: Update Package.swift manifest
run: make manifest url="https://github.com/Stremio/stremio-core-swift/releases/download/${{ github.event.inputs.version }}/StremioCore.xcframework.zip" sha256="$(cat .build/StremioCore.xcframework.zip.sha256)"
- name: Push Package.swift manifest
run: |
git add .
git commit -m "Release version ${{ github.event.inputs.version }}"
git push
- name: Push git tag
run: |
git tag "${{ github.event.inputs.version }}"
git push --tags
- name: Upload build artifact to GitHub release assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.version }}
file: ./.build/StremioCore.xcframework.zip*
file_glob: true
overwrite: true
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/bridge/stremio/
/bridge/wrapper.hpp
.DS_Store
/Cargo.lock
/.build
/Packages
xcuserdata/
Expand Down
Loading

0 comments on commit 27fec76

Please sign in to comment.