-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.37 KB
/
cli_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: RubyGems Deploy
on:
workflow_dispatch:
jobs:
build:
name: Build and Deploy CLI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
steps:
- uses: actions/checkout@v4
- name: Set up Ruby and install dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.3'
bundler-cache: true
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: Build and install gem locally
run: |
bundle exec rake build
gem install pkg/*.gem
- name: Test emerge CLI
run: |
# Update PATH to include both system and user gem paths
export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$(ruby -e 'puts Gem.dir')/bin:$PATH"
OUTPUT=$(emerge -h 2>&1 || true)
echo "$OUTPUT"
# Check for expected strings
echo "$OUTPUT" | grep -q "emerge integrate \[SUBCOMMAND\]" || { echo "Expected integrate command not found"; exit 1; }
echo "$OUTPUT" | grep -q "emerge upload \[SUBCOMMAND\]" || { echo "Expected upload command not found"; exit 1; }
- name: Release Gem
uses: rubygems/release-gem@v1