diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 692cf77..f6bc4f1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,8 +30,10 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} repository: sjaek/logstash-output-snmptrap - tags: ${LOGSTASH_VERSION}-${steps.get_version.outputs.VERSION} + tags: ${LOGSTASH_VERSION}-${{steps.get_version.outputs.VERSION}} push: ${{ startsWith(github.ref, 'refs/tags/') }} - build_args: LOGSTASH_VERSION=${LOGSTASH_VERSION},PLUGIN_VERSION=${steps.get_version.outputs.VERSION} + labels: LOGSTASH_VERSION=${LOGSTASH_VERSION},PLUGIN_VERSION=${{steps.get_version.outputs.VERSION}} + build_args: LOGSTASH_VERSION=${LOGSTASH_VERSION},PLUGIN_VERSION=${{steps.get_version.outputs.VERSION}} env: LOGSTASH_VERSION: 7.8.1 + diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index e249b20..61ab035 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -10,6 +10,10 @@ jobs: runs-on: ubuntu-latest steps: + - name: Get the tag name + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - uses: actions/checkout@v2 - name: Set up Ruby 2.6 uses: actions/setup-ruby@v1 @@ -26,3 +30,4 @@ jobs: gem push *.gem env: GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" + GEM_VERSION: "${{steps.get_version.outputs.VERSION}}" diff --git a/logstash-output-snmptrap.gemspec b/logstash-output-snmptrap.gemspec index ab7539d..8b92ed6 100644 --- a/logstash-output-snmptrap.gemspec +++ b/logstash-output-snmptrap.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'logstash-output-snmptrap-v2' - s.version = '0.9.4' + s.version = ENV['GEM_VERSION'] || '0.0.1' s.licenses = ['Apache-2.0'] s.summary = 'SNMP Output for Logstash' s.description = 'This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program'