Skip to content

Commit

Permalink
Remove scripts and update workflows to use actions in external repo (#30
Browse files Browse the repository at this point in the history
)
  • Loading branch information
daniel-barros authored Apr 26, 2023
1 parent 7d44aa8 commit 2fe1c7c
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 346 deletions.
52 changes: 4 additions & 48 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,7 @@ jobs:
create-release-branch:
runs-on: macos-latest
steps:

# Check out the repo at the specified branch or tag.
- name: Checkout Branch
uses: actions/checkout@v3

# Validate adapter and partner versions are compatible.
- name: Validate Adapter and Partner Version Match
run: ruby ./Scripts/validate-adapter-and-partner-versions.rb "${{ inputs.adapter-version }}" "${{ inputs.partner-version }}"
shell: bash

# Validate adapter version is well-formed and not already released.
- name: Validate Adapter Version
run: ruby ./Scripts/validate-new-release-version.rb "${{ inputs.adapter-version }}"
shell: bash

# Validate partner version is well-formed.
- name: Validate Partner Version
run: ruby ./Scripts/validate-partner-version.rb "${{ inputs.partner-version }}"
shell: bash

# Create and checkout branch
- name: Create Branch
run: git checkout -b "release/${{ inputs.adapter-version }}"
shell: bash

# Update version strings in podspec.
- name: Update Version Strings in Podspec
run: ruby ./Scripts/update-podspec-versions.rb "${{ inputs.adapter-version }}" "${{ inputs.partner-version }}"
shell: bash

# Update version string in main adapter class.
- name: Update Version String in Partner Adapter Class
run: ruby ./Scripts/update-adapter-class-version.rb "${{ inputs.adapter-version }}"
shell: bash

# Add new changelog entry for the current adapter version.
- name: Add Changelog Entry
run: ruby ./Scripts/add-changelog-entry.rb "${{ inputs.adapter-version }}" "${{ inputs.partner-version }}"
shell: bash

# Commit and push changes.
- name: Push Changes
run: git add *.podspec CHANGELOG.md Source/*Adapter.swift && git commit -m "[AUTO-GENERATED] Update version to ${{ inputs.adapter-version }}" && git push -u origin "release/${{ inputs.adapter-version }}"
shell: bash

# Open a pull request from the new branch to main.
- name: Open Pull Request
run: gh pr create --base "main" --reviewer "@ChartBoost/helium-ios" --title "Update Version to ${{ inputs.adapter-version }}" --body "Adapter version '${{ inputs.adapter-version }}', partner version '${{ inputs.partner-version }}'" --label "do not merge"
- uses: chartboost/chartboost-mediation-ios-actions/create-adapter-release-branch@v1
with:
adapter-version: ${{ inputs.adapter-version }}
partner-version: ${{ inputs.partner-version }}
29 changes: 2 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,6 @@ jobs:
release-adapter:
runs-on: macos-latest
steps:
# Check out the repo.
- name: Checkout
uses: actions/checkout@v3

# Obtain the new adapter version.
- name: Obtain Adapter Version
id: release_version
run: echo "version=$(ruby ./Scripts/adapter-version.rb)" >> $GITHUB_OUTPUT
shell: bash

# Push the release tag.
- name: Tag
run: git tag ${{ steps.release_version.outputs.version }} && git push origin ${{ steps.release_version.outputs.version }}
shell: bash

# Push the podspec.
- name: Push Podspec
run: pod trunk push --verbose --allow-warnings

# Create GitHub release.
- name: Create Release
uses: actions/create-release@v1
- uses: chartboost/chartboost-mediation-ios-actions/release-adapter@v1
with:
tag_name: ${{ steps.release_version.outputs.version }}
release_name: ${{ steps.release_version.outputs.version }}
body: ''
draft: false
prerelease: false
allow-warnings: true
15 changes: 3 additions & 12 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ jobs:
validate-podspec:
runs-on: macos-latest
steps:
# Check out the repo.
- name: Checkout
uses: actions/checkout@v3

# Check that the adapter version in the podpsec and in the PartnerAdapter Swift implementation are the same.
- name: Validate Adapter and Podspec Version Match
run: ruby ./Scripts/validate-adapter-version.rb
shell: bash

# Validate the podspec.
- name: Validate Podspec
run: pod lib lint --verbose --allow-warnings
- uses: chartboost/chartboost-mediation-ios-actions/adapter-smoke-test@v1
with:
allow-warnings: true
4 changes: 0 additions & 4 deletions Scripts/adapter-version.rb

This file was deleted.

24 changes: 0 additions & 24 deletions Scripts/add-changelog-entry.rb

This file was deleted.

138 changes: 0 additions & 138 deletions Scripts/common.rb

This file was deleted.

16 changes: 0 additions & 16 deletions Scripts/update-adapter-class-version.rb

This file was deleted.

24 changes: 0 additions & 24 deletions Scripts/update-podspec-versions.rb

This file was deleted.

15 changes: 0 additions & 15 deletions Scripts/validate-adapter-and-partner-versions.rb

This file was deleted.

4 changes: 0 additions & 4 deletions Scripts/validate-adapter-version.rb

This file was deleted.

22 changes: 0 additions & 22 deletions Scripts/validate-new-release-version.rb

This file was deleted.

12 changes: 0 additions & 12 deletions Scripts/validate-partner-version.rb

This file was deleted.

0 comments on commit 2fe1c7c

Please sign in to comment.