From 206e3d7651276b701fa8881017c89c1c544540a5 Mon Sep 17 00:00:00 2001 From: Jose Lloret Date: Thu, 22 Aug 2024 22:10:36 +0200 Subject: [PATCH] testing tag creation/push --- .github/workflows/release.yml | 33 +++++++++++++++++++++++---------- lib/harmoniser/version.rb | 2 +- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da8a958..dad79dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,14 +2,14 @@ name: Harmoniser Release on: push: - branches: [ "master" ] + branches: [ "wadus" ] jobs: publish: name: Publish runs-on: ubuntu-latest permissions: - contents: read + contents: write packages: write steps: @@ -19,13 +19,26 @@ jobs: with: ruby-version: 3.2.2 - - name: Publish to RubyGems + # - name: Publish to RubyGems + # run: | + # mkdir -p $HOME/.gem + # touch $HOME/.gem/credentials + # chmod 0600 $HOME/.gem/credentials + # printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials + # gem build *.gemspec + # gem push *.gem + # env: + # GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" + + - name: Get version from gemspec + id: get_version + run: echo "VERSION=$(ruby -e 'puts \"wadus\"')" >> $GITHUB_OUTPUT + + - name: Create and Push Git Tag run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push *.gem + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + git tag v${{ steps.get_version.outputs.VERSION }} + git push origin v${{ steps.get_version.outputs.VERSION }} env: - GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/lib/harmoniser/version.rb b/lib/harmoniser/version.rb index 521c476..2cd5d31 100644 --- a/lib/harmoniser/version.rb +++ b/lib/harmoniser/version.rb @@ -1,3 +1,3 @@ module Harmoniser - VERSION = "0.9.0" + VERSION = "0.0.0" end