diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6a25c4a --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e398778 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 \ No newline at end of file diff --git a/FigmaExport.podspec b/FigmaExport.podspec index a4efca8..b24d193 100644 --- a/FigmaExport.podspec +++ b/FigmaExport.podspec @@ -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" => "mail@subdan.ru" } - 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 diff --git a/Release/figma-export b/Release/figma-export deleted file mode 100755 index f139f25..0000000 Binary files a/Release/figma-export and /dev/null differ