Skip to content

Commit

Permalink
[GitHub] Add Release workflow to publish binaries
Browse files Browse the repository at this point in the history
We cannot reuse worklow jobs on GA, worth subscribing:
actions/runner#438
JIRA: EE-1157
  • Loading branch information
vguerci committed Jul 21, 2020
1 parent 9d67852 commit 962dc0f
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release

on:
push:
tags: [ '*' ]

jobs:
test-and-release:
# Clone of main test workflow
runs-on: macos-10.15

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Ruby setup
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6

- name: Bundle cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle install
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Cocoapods cache
uses: actions/cache@v2
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Cocoapods install
run: |
bundle exec fastlane run cocoapods
- name: Java setup
uses: actions/setup-java@v1
with:
java-version: '11'
- name: WireMock setup
run: |
curl https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.27.0/wiremock-jre8-standalone-2.27.0.jar -o wiremock.jar -s
bundle exec iostrust add ./wiremock/cert/wiremock.crt
java -jar wiremock.jar --https-port 9099 --root-dir wiremock --https-keystore wiremock/cert/wiremock.jks --keystore-password password --verbose &
- name: Test
run: |
bundle exec fastlane test
# Publish additional steps to test job
- name: Archive
run: |
./scripts/archive.sh
- name: Generate Changelog
run: |
bundle exec fastlane last_changelog
- name: Release
uses: softprops/action-gh-release@v1
with:
files: build/output/*.zip
body_path: last-changelog.md
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,14 @@ platform :ios do
files: files,
)
end

desc %(Extract last version changelog)
lane :last_changelog do
changelog = File.open("../CHANGELOG.md").read
last_changelog = changelog
.split(/----*\n/)[1] # Get last version section
.lines[2..-1].join # Remove first line that contains version
.strip!
File.write('../last-changelog.md', last_changelog)
end
end
5 changes: 5 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ Check code format
fastlane ios format
```
Format code
### ios last_changelog
```
fastlane ios last_changelog
```
Extract last version changelog

----

Expand Down

0 comments on commit 962dc0f

Please sign in to comment.