forked from kyledecot/app_store_connect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor Workflows * Add Rake * Add Rakefile * Add Tasks * Remove bin/publish * Remove Docker Steps from Workflow
- Loading branch information
Showing
13 changed files
with
226 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
--- | ||
name: Default | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby 2.6 | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6.x | ||
- uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: ${{ runner.os }}-gems- | ||
- name: Install Bundler | ||
run: gem install bundler | ||
- name: Configure Bundler | ||
run: bundle config path vendor/bundle | ||
- name: Bundle Install | ||
run: bundle install --jobs 4 --retry 3 | ||
- name: Set APP_STORE_CONNECT_VERSION | ||
run: echo ::set-env name=APP_STORE_CONNECT_VERSION::$(bundle exec rake version:current) | ||
- name: Build | ||
run: bundle exec rake build | ||
- name: Upload Gem | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: app_store_connect-${{ env.APP_STORE_CONNECT_VERSION }}.gem | ||
path: app_store_connect-${{ env.APP_STORE_CONNECT_VERSION }}.gem | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby 2.6 | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6.x | ||
- uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: ${{ runner.os }}-gems- | ||
- name: Install Bundler | ||
run: gem install bundler | ||
- name: Configure Bundler | ||
run: bundle config path vendor/bundle | ||
- name: Bundle Install | ||
run: bundle install --jobs 4 --retry 3 | ||
- name: Run Rubocop | ||
run: bundle exec rubocop | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby 2.6 | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6.x | ||
- uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: ${{ runner.os }}-gems- | ||
- name: Install Bundler | ||
run: gem install bundler | ||
- name: Configure Bundler | ||
run: bundle config path vendor/bundle | ||
- name: Bundle Install | ||
run: bundle install --jobs 4 --retry 3 | ||
- name: Run RSpec | ||
run: bundle exec rake spec | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
needs: [test, lint] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby 2.6 | ||
uses: actions/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6.x | ||
- uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: ${{ runner.os }}-gems- | ||
- name: Install Bundler | ||
run: gem install bundler | ||
- name: Configure Bundler | ||
run: bundle config path vendor/bundle | ||
|
||
- name: Configure Gem | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${{secrets.RUBYGEMS_API_KEY}}\n:github: Bearer ${{secrets.PERSONAL_ACCESS_TOKEN}}" > $HOME/.gem/credentials | ||
- name: Bundle Install | ||
run: bundle install --jobs 4 --retry 3 | ||
- name: Set APP_STORE_CONNECT_VERSION | ||
run: echo ::set-env name=APP_STORE_CONNECT_VERSION::$(bundle exec rake version:current) | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: app_store_connect-${{ env.APP_STORE_CONNECT_VERSION }}.gem | ||
path: /tmp | ||
- run: mv /tmp/app_store_connect-${{ env.APP_STORE_CONNECT_VERSION }}.gem . | ||
- name: Push Gem to Rubygems | ||
run: bundle exec rake release[rubygems] | ||
continue-on-error: true | ||
- name: Push Gem to Github Package Registry | ||
run: bundle exec rake release[github] | ||
continue-on-error: true | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: app_store_connect-${{ env.APP_STORE_CONNECT_VERSION }}.gem | ||
asset_name: app_store_connect-${{ env.APP_STORE_CONNECT_VERSION }}.gem | ||
asset_content_type: application/binary | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rspec/core/rake_task' | ||
|
||
Dir.glob('lib/tasks/*.rake').each { |r| load r } | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
task default: :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'app_store_connect/version' | ||
|
||
desc "Build app_store_connect-#{AppStoreConnect::VERSION}.gem" | ||
task :build do | ||
sh %(gem build app_store_connect.gemspec) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'pry' | ||
require 'app_store_connect' | ||
|
||
desc 'Start a pry console' | ||
task :console do | ||
Pry.start(AppStoreConnect::Client.new) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'app_store_connect/version' | ||
|
||
version = AppStoreConnect::VERSION | ||
|
||
desc "Release app_store_connect-#{version}.gem" | ||
task :release, [:key] do |_task, args| | ||
args.with_defaults(key: 'rubygems') | ||
|
||
key = args.key.to_sym | ||
host = { | ||
rubygems: 'https://rubygems.org', | ||
github: 'https://rubygems.pkg.github.com/kyledecot' | ||
}.fetch(key) | ||
|
||
sh %(gem push --key=#{key} --host=#{host} app_store_connect-#{version}.gem) | ||
end |
Oops, something went wrong.