Skip to content

Commit a282136

Browse files
committed
Add assets uploading for releases
1 parent cdd15e0 commit a282136

File tree

3 files changed

+21
-38
lines changed

3 files changed

+21
-38
lines changed

.github/workflows/build.yml

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v1
15-
with:
16-
fetch-depth: 1
1715

1816
- name: Restore cached pods
1917
uses: actions/cache@v1

.github/workflows/release.yml

+19-34
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ on:
66

77
jobs:
88
bootstrap_build:
9-
name: Bootstrap and Build
9+
name: Build and release
1010
runs-on: macOS-latest
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v1
14-
with:
15-
fetch-depth: 1
1614

1715
- name: Restore cached pods
1816
uses: actions/cache@v1
@@ -50,43 +48,30 @@ jobs:
5048
name: archived
5149
path: ./tmp
5250

53-
release:
54-
name: Release
55-
runs-on: macOS-latest
56-
needs: [bootstrap_build]
57-
steps:
58-
- name: Checkout
59-
uses: actions/checkout@v1
60-
with:
61-
fetch-depth: 1
62-
63-
- name: Download artifacts
64-
uses: actions/download-artifact@v1
65-
with:
66-
name: archived
67-
68-
- name: Restore cached gems
69-
uses: actions/cache@v1.0.0
70-
id: restore-gems
71-
with:
72-
path: vendor
73-
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
74-
restore-keys: |
75-
${{ runner.os }}-gems-
76-
77-
- name: Make gems
78-
if: steps.restore-gems.outputs.cache-hit != 'true'
79-
run: make gems
80-
8151
- name: Generate podspec
8252
run: make generate-podspec
8353

84-
- name: Release on Github
85-
uses: softprops/action-gh-release@v1
54+
- name: Create Release
55+
id: create_release
56+
uses: actions/create-release@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8659
with:
87-
files: archived
60+
tag_name: ${{ github.ref }}
61+
release_name: Release ${{ github.ref }}
62+
draft: false
63+
prerelease: false
64+
65+
- name: Upload Release Asset
66+
id: upload-release-asset
67+
uses: actions/upload-release-asset@v1
8868
env:
8969
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
with:
71+
upload_url: ${{ steps.create_release.outputs.upload_url }}
72+
asset_path: ./fibs.zip
73+
asset_name: fibs.zip
74+
asset_content_type: application/zip
9075

9176
- name: Upload to Cocoapods
9277
env:

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LIB_ENVPLUGIN_DYLIB=$(EXECUTABLE_FOLDER)/$(LIB_ENVPLUGIN_DYLIB_NAME)
1717
LIB_HCAPLUGIN_DYLIB=$(EXECUTABLE_FOLDER)/$(LIB_HCAPLUGIN_DYLIB_NAME)
1818
LIB_MEMPLUGIN_DYLIB=$(EXECUTABLE_FOLDER)/$(LIB_MEMPLUGIN_DYLIB_NAME)
1919
LICENSE_PATH="$(shell pwd)/LICENSE.md"
20-
GIT_CURRENT_TAG="$(shell git describe --abbrev=0 --tags)"
20+
GIT_CURRENT_TAG=$(shell git describe --abbrev=0 --tags)
2121

2222
define PODSPEC_CONTENTS
2323
{
@@ -67,7 +67,7 @@ generate-project: ## Genetate xcode project and bootstrap swift dependencies
6767
gems: ## Bootstrap gems dependencies
6868
gem install bundler -v 2.0.2
6969
@echo "--- Installing gems..."
70-
bundle check --path vendor/bundle || bundle install --jobs=4 --path vendor/bundle --quiet
70+
bundle check || bundle install
7171

7272
build-release: ## Build with release configuration
7373
swift build $(SWIFT_BUILD_FLAGS)

0 commit comments

Comments
 (0)