diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..212506516 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 9edbaede5..09aee1d78 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -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 diff --git a/fastlane/README.md b/fastlane/README.md index d7227751a..6088a5209 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -34,6 +34,11 @@ Check code format fastlane ios format ``` Format code +### ios last_changelog +``` +fastlane ios last_changelog +``` +Extract last version changelog ----