Skip to content

Commit

Permalink
Revert "fix(): Use common tag-and-release workflow (#16)"
Browse files Browse the repository at this point in the history
This reverts commit 8e89b05.
  • Loading branch information
kevintylerstark committed Oct 1, 2024
1 parent 8e89b05 commit ad6a06e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 12 deletions.
69 changes: 62 additions & 7 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,68 @@ on:
push:
branches:
- main
paths:
- 'lib/**/version.rb'
paths: 'lib/**/version.rb'

jobs:
release:
uses: rewindio/github-action-common/.github/workflows/tag-and-release.yml@v1
with:
registry: rubygems
secrets:
REGISTRY_API_KEY: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@main

- name: Set up Ruby 3.2.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2

- name: Get version
id: get_version
run: |
version_file=$(find ./lib -name version.rb)
version=$(grep VERSION $version_file |cut -f 2 -d= |tr -d \'|tr -d [:space:])
echo version=$version >> $GITHUB_OUTPUT
echo version_tag=v$version >> $GITHUB_OUTPUT
- name: Tag commit
uses: tvdias/github-tagger@ed7350546e3e503b5e942dffd65bc8751a95e49d # v0.0.2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
tag: "${{steps.get_version.outputs.version_tag}}"

- name: Upload to Rubygems
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
set +e
mkdir -p ~/.gem
touch ~/.gem/credentials
chmod 600 ~/.gem/credentials
echo ":rubygems_api_key: ${RUBYGEMS_API_KEY}" >> ~/.gem/credentials
gemspec=$(ls *gemspec* | head -1)
gem build $gemspec
gem_name=$(ls -t *.gem | head -1)
output=$(gem push *.gem)
if [[ $output != *"Successfully"* ]]; then
echo "Error uploading to Rubygems: $output"
rm -f ~/.gem/credentials
exit 1
else
echo "Successfully uploaded to Rubygems: $output"
rm -f ~/.gem/credentials
fi
- name: Extract from changelog
id: extract_changes
run: |
# Must use a temporary file or it loses the formatting
VERSION=${{steps.get_version.outputs.version}}; awk "/## \[$VERSION\]/{flag=1;next}/## \[/{flag=0}flag" CHANGELOG.md > REL-BODY.md
- name: Create Release
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
with:
tag: ${{steps.get_version.outputs.version_tag}}
artifacts: "*.gem, CHANGELOG.md"
bodyFile: "REL-BODY.md"
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Changelog
## [1.0.3]

- Validate new tag and release workflow

## [1.0.2]

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
omniauth-azure-devops (1.0.3)
omniauth-azure-devops (1.0.2)
omniauth (>= 1, < 3)
omniauth-oauth2 (~> 1.1)

Expand Down
2 changes: 1 addition & 1 deletion lib/omni_auth/azure_devops/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module OmniAuth
module AzureDevops
VERSION = '1.0.3'
VERSION = '1.0.2'
end
end

0 comments on commit ad6a06e

Please sign in to comment.