Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
if: github.repository == 'appium/ruby_lib_core'
runs-on: ubuntu-latest
outputs:
gem_path: ${{ steps.package.outputs.gem_path }}
gem_filename: ${{ steps.artifact.outputs.gem-filename }}
steps:
- name: Validate tag syntax
shell: bash
Expand Down Expand Up @@ -52,14 +52,22 @@ jobs:
run: |
bundle exec rbs collection install
bundle exec rake rubocop steep test:unit
bundle exec ruby test/release/release_test.rb
- name: Validate the built gem
id: package
run: ruby script/release.rb verify "$RELEASE_TAG" >> "$GITHUB_OUTPUT"
uses: appium/appium-workflows/.github/actions/ruby-release-validate@b9358466aa945baa7afa4d8f177d9fa4f4515bc0
with:
gem-name: appium_lib_core
version-file: lib/appium_lib_core/version.rb
tag: ${{ env.RELEASE_TAG }}
- name: Record artifact filename for the publishing job
id: artifact
env:
VERIFIED_GEM_PATH: ${{ steps.package.outputs.gem-path }}
run: echo "gem-filename=$(basename "$VERIFIED_GEM_PATH")" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
with:
name: release-gem
path: ${{ steps.package.outputs.gem_path }}
path: ${{ steps.package.outputs.gem-path }}
if-no-files-found: error
retention-days: 14

Expand All @@ -82,5 +90,5 @@ jobs:
uses: rubygems/configure-rubygems-credentials@daab0479595bcc124493903b3df17273d86e073f
- name: Publish the verified gem
env:
GEM_PATH_TO_PUBLISH: ${{ needs.verify.outputs.gem_path }}
GEM_PATH_TO_PUBLISH: pkg/${{ needs.verify.outputs.gem_filename }}
run: gem push --host https://rubygems.org "$GEM_PATH_TO_PUBLISH"
15 changes: 7 additions & 8 deletions .github/workflows/release-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ jobs:
with:
ruby-version: '4.0'
bundler-cache: true
- name: Test release validation
run: |
bundle exec rubocop script/release.rb
bundle exec ruby test/release/release_test.rb
- name: Build and validate gem
run: |
bundle exec rake build
ruby script/release.rb verify
- name: Build gem
run: bundle exec rake build
- name: Validate built gem
uses: appium/appium-workflows/.github/actions/ruby-release-validate@b9358466aa945baa7afa4d8f177d9fa4f4515bc0
with:
gem-name: appium_lib_core
version-file: lib/appium_lib_core/version.rb
34 changes: 26 additions & 8 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ is for stable releases from master, not a parallel prerelease branch.
## Recovery

- **Release PR has a date mismatch:** rerun **Release Please**. Alternatively, check
out its branch, run `ruby script/release.rb prepare-date`, and commit the date
change. Do not edit the date to the upload day independently of the changelog.
out its branch, use the shared validator’s `prepare-date` command described
below, and commit the date change. Do not edit the date to the upload day independently of the changelog.
- **PR checks do not start:** inspect the **Run release PR checks** step, Actions
policy, and workflow permissions. Each dispatched workflow must exist on master.
Retry the affected workflow from the generated PR branch using **Run workflow**;
Expand All @@ -104,7 +104,7 @@ is for stable releases from master, not a parallel prerelease branch.
not necessarily emit an already-created release again. The verified artifact is kept for 14 days.
If it has expired, run **Publish gem** manually from master with the same existing
release tag; it rechecks and rebuilds that tag. This retry route is for releases
containing this workflow and validation script, not older historical tags.
containing this publishing workflow, not older historical tags.
- **RubyGems already has that version:** confirm the existing release before retrying.
The workflow deliberately does not treat every push failure as success. Published
versions cannot be overwritten. Do not move the tag or rebuild different source
Expand All @@ -119,14 +119,32 @@ is for stable releases from master, not a parallel prerelease branch.
bundle install
bundle exec rbs collection install
UNIT_TEST=true bundle exec rake rubocop steep test:unit
bundle exec ruby test/release/release_test.rb
bundle exec rake build
ruby script/release.rb verify
```

To validate a prospective tag, pass `v<version>` to `verify`. This checks metadata;
it does not create the tag. `prepare-date` changes only the local version file.
Neither script command pushes or publishes. `bundle exec rake build` only builds.
The CI workflows use the shared [ruby-release-validate Action](https://github.com/appium/appium-workflows/tree/b9358466aa945baa7afa4d8f177d9fa4f4515bc0/.github/actions/ruby-release-validate),
pinned to commit `b9358466aa945baa7afa4d8f177d9fa4f4515bc0`. Its validation tests are maintained
in that repository; this repository keeps its own application tests.

For local metadata/package verification, clone the shared repository alongside
this checkout, then run the same validator (adjust paths as needed):

```sh
git clone https://github.com/appium/appium-workflows.git ../appium-workflows
git -C ../appium-workflows checkout b9358466aa945baa7afa4d8f177d9fa4f4515bc0
ruby ../appium-workflows/.github/actions/ruby-release-validate/release.rb \
verify --root . --gem-name appium_lib_core --version-file lib/appium_lib_core/version.rb
```

Add `--tag v<version>` to verify a prospective tag. For date recovery, replace
`verify` with `prepare-date` and omit `--tag`; it copies the changelog date into
the local version file. Neither command pushes or publishes. If the shared
checkout already exists, use it instead of cloning again.

The Action returns an absolute `gem-path` for artifact upload. The workflow passes
only the filename to the separate publishing job, which downloads the artifact
into its own `pkg/` directory. The publishing workflow, `rubygems` environment,
and Trusted Publisher registration remain in this repository.

The repository bootstrap is pinned to the existing `v13.1.0` commit
`e099307ee1868986215f66002caf05b6f514aafe`, with manifest version `13.1.0`. This avoids
Expand Down
76 changes: 0 additions & 76 deletions script/release.rb

This file was deleted.

116 changes: 0 additions & 116 deletions test/release/release_test.rb

This file was deleted.

Loading