-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from modestman/feature/github-actions
Add github actions for run tests and release
- Loading branch information
Showing
4 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
release: | ||
name: Publish GitHub and Cocoapods release | ||
runs-on: macOS-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
run: | | ||
swift build -c release | ||
cp ./.build/x86_64-apple-macosx/release/figma-export ./Release/figma-export | ||
zip -r figma-export.zip Release LICENSE | ||
- name: "Get upload_url" | ||
run: echo "::set-output name=upload_url::https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)/assets{?name,label}" | ||
id: release | ||
|
||
- name: Upload GitHub Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
asset_path: ./figma-export.zip | ||
asset_name: figma-export.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Install Cocoapods | ||
run: gem install cocoapods | ||
|
||
- name: Deploy to Cocoapods | ||
run: | | ||
set -eo pipefail | ||
pod trunk push FigmaExport.podspec | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Test | ||
on: | ||
# Trigger the workflow on push or pull request, | ||
# for all branches, but never trigger on new tags | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: macOS-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Copy config | ||
run: cp Release/figma-export.yaml ./ | ||
- name: Build and test | ||
run: swift test --enable-code-coverage --disable-automatic-resolution |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,6 @@ Pod::Spec.new do |spec| | |
spec.homepage = "https://github.com/RedMadRobot/figma-export" | ||
spec.license = { type: "MIT", file: "LICENSE" } | ||
spec.author = { "Daniil Subbotin" => "[email protected]" } | ||
spec.source = { git: 'https://github.com/RedMadRobot/figma-export.git', tag: spec.version.to_s } | ||
spec.preserve_paths = 'Release/figma-export' | ||
spec.source = { http: "#{spec.homepage}/releases/download/#{spec.version}/figma-export.zip" } | ||
spec.preserve_paths = '*' | ||
end |
Binary file not shown.