From 705bc5283abc8864741e473fc80d41d2fc5b390b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arist=C3=B3teles?= Date: Sun, 29 Sep 2024 17:51:27 -0300 Subject: [PATCH 1/3] chore: add publish gem version on github actions --- .github/workflows/publish.yaml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..e7f73b9 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,41 @@ +name: Publish Gem + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + name: Ruby ${{ matrix.ruby }} + strategy: + matrix: + ruby: + - '3.2.2' + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + bundler-cache: true + + - name: Install bundler + run: gem install bundler + + - name: Install dependencies + run: bundle install + + - name: Build gem + run: gem build lennarb.gemspec + + - name: Push gem to RubyGems + env: + RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} + run: | + gem push lennarb-*.gem From 6313ecb70009cf33dc950a8fb751b5fcf38d3b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arist=C3=B3teles?= Date: Sun, 29 Sep 2024 17:54:00 -0300 Subject: [PATCH 2/3] chore: execute only main branch --- .github/workflows/publish.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e7f73b9..99deeea 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: build: From 5d78f7255c822d8406d4ab1faa43806d72a29192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arist=C3=B3teles?= Date: Sun, 29 Sep 2024 17:57:35 -0300 Subject: [PATCH 3/3] chore: fix GA --- .github/workflows/publish.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 99deeea..b59abe8 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -21,18 +21,15 @@ jobs: with: ruby-version: 3.2 bundler-cache: true - - name: Install bundler run: gem install bundler - - name: Install dependencies run: bundle install - - name: Build gem run: gem build lennarb.gemspec - - name: Push gem to RubyGems env: RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} run: | - gem push lennarb-*.gem + ls *.gem + gem push $(ls *.gem)