Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby GitHub Packages

Ruby GitHub Packages

RubyGems is the default server when publishing a public gem but, sometimes, you can't open source your work. An alternative solution is to use GitHub Packages for publishing private gems so your internal programs, applications, and/or services can have the same convenience as what you'd find when using RubyGems. In this talk, you'll learn how to use Gemsmith to publish your gem to your own GitHub Packages repository while using GitHub Actions to automate the entire process.

Brooke Kuhlmann

April 15, 2022
Tweet

More Decks by Brooke Kuhlmann

Other Decks in Programming

Transcript

  1. Ruby GitHub Packages
    Presented by Brooke Kuhlmann

    View Slide

  2. Overview

    View Slide

  3. • Gemsmith
    Overview

    View Slide

  4. • Gemsmith
    • Server Choices
    Overview

    View Slide

  5. • Gemsmith
    • Server Choices
    • GitHub Packages + Actions
    Overview

    View Slide

  6. • Gemsmith
    • Server Choices
    • GitHub Packages + Actions
    • Source Code
    Overview

    View Slide

  7. • Gemsmith
    • Server Choices
    • GitHub Packages + Actions
    • Source Code
    • Debugging Techniques
    Overview

    View Slide

  8. Servers

    View Slide

  9. RubyGems
    (public)
    Servers

    View Slide

  10. RubyGems GitHub Packages
    (public) (private)
    Servers

    View Slide

  11. RubyGems GitHub Packages
    (public) (private)
    Gemfury
    (private)
    Servers

    View Slide

  12. https://www.alchemists.io/projects/gemsmith

    View Slide

  13. Gemsmith
    https://www.alchemists.io/projects/gemsmith

    View Slide

  14. https://docs.github.com/en/packages

    View Slide

  15. GitHub Packages
    https://docs.github.com/en/packages

    View Slide

  16. https://docs.github.com/en/packages

    View Slide

  17. https://docs.github.com/en/packages

    View Slide

  18. https://docs.github.com/en/packages

    View Slide

  19. https://docs.github.com/en/packages

    View Slide

  20. https://docs.github.com/en/packages

    View Slide

  21. https://docs.github.com/en/packages

    View Slide

  22. https://docs.github.com/en/packages

    View Slide

  23. https://docs.github.com/en/packages

    View Slide

  24. https://docs.github.com/en/actions

    View Slide

  25. GitHub Actions
    https://docs.github.com/en/actions

    View Slide

  26. https://docs.github.com/en/actions

    View Slide

  27. New
    Version
    🚀
    https://docs.github.com/en/actions

    View Slide

  28. New
    Version
    🚀
    https://docs.github.com/en/actions

    View Slide

  29. New
    Version
    🚀
    1
    https://docs.github.com/en/actions

    View Slide

  30. New
    Version
    🚀
    1. Builds releases notes.
    1
    https://docs.github.com/en/actions

    View Slide

  31. New
    Version
    🚀
    1. Builds releases notes.
    2. Tags version.
    1
    https://docs.github.com/en/actions

    View Slide

  32. New
    Version
    🚀
    1. Builds releases notes.

    2. Tags version.

    3. Publishes gem.
    1
    https://docs.github.com/en/actions

    View Slide

  33. New
    Version
    🚀
    2
    https://docs.github.com/en/actions

    View Slide

  34. https://docs.github.com/en/actions

    View Slide

  35. Existing
    Version

    https://docs.github.com/en/actions

    View Slide

  36. Existing
    Version

    Benign 🎉
    https://docs.github.com/en/actions

    View Slide

  37. https://docs.github.com/en/actions

    View Slide

  38. No
    Versions
    🚫
    https://docs.github.com/en/actions

    View Slide

  39. No
    Versions
    🚫
    https://docs.github.com/en/actions

    View Slide

  40. No
    Versions
    🚫
    💡 Only
    fi
    rst version is manual.
    https://docs.github.com/en/actions

    View Slide

  41. View Slide

  42. Source Code

    View Slide

  43. https://www.alchemists.io/projects/gemsmith

    View Slide

  44. Gem Credentials
    https://www.alchemists.io/projects/gemsmith

    View Slide

  45. https://www.alchemists.io/projects/gemsmith

    View Slide

  46. https://www.alchemists.io/projects/gemsmith
    # $HOME/.gem/credentials
    :rubygems_api_key:
    https://rubygems.pkg.github.com/alchemists: Bearer

    View Slide

  47. https://www.alchemists.io/projects/gemsmith
    # $HOME/.gem/credentials
    :rubygems_api_key:
    https://rubygems.pkg.github.com/alchemists: Bearer

    View Slide

  48. https://www.alchemists.io/projects/gemsmith
    # $HOME/.gem/credentials
    :rubygems_api_key:
    https://rubygems.pkg.github.com/alchemists: Bearer

    View Slide

  49. https://www.alchemists.io/projects/gemsmith
    # $HOME/.gem/credentials
    :rubygems_api_key:
    https://rubygems.pkg.github.com/alchemists: Bearer

    View Slide

  50. https://www.alchemists.io/projects/gemsmith
    # $HOME/.gem/credentials
    :rubygems_api_key:
    https://rubygems.pkg.github.com/alchemists: Bearer
    (also your gem speci
    fi
    cation value)

    View Slide

  51. https://www.alchemists.io/projects/gemsmith
    # $HOME/.gem/credentials
    :rubygems_api_key:
    https://rubygems.pkg.github.com/alchemists: Bearer
    Personal Access Token

    View Slide

  52. https://www.alchemists.io/projects/gemsmith

    View Slide

  53. Gem Speci
    fi
    cation
    https://www.alchemists.io/projects/gemsmith

    View Slide

  54. https://www.alchemists.io/projects/gemsmith

    View Slide

  55. Gem::Specification.new do |spec|
    spec.name = "demo"
    spec.version = "0.0.0"
    spec.authors = ["Alchemists Engineering"]
    spec.email = ["e[email protected]"]
    spec.homepage = "https://www.alchemists.io/projects/demo"
    spec.summary = "This is a demo gem."
    spec.license = "Nonstandard"
    spec.metadata = {
    "allowed_push_host" => "https://rubygems.pkg.github.com/alchemists",
    "bug_tracker_uri" => "https://github.com/alchemists/demo/issues",
    "changelog_uri" => "https://www.alchemists.io/projects/demo/versions",
    "documentation_uri" => "https://www.alchemists.io/projects/demo",
    "label" => "Demo",
    "source_code_uri" => "https://github.com/alchemists/demo"
    }
    spec.required_ruby_version = "~> 3.1"
    spec.add_dependency "auto_injector", "~> 0.4"
    spec.add_dependency "dry-container", "~> 0.9"
    spec.add_dependency "refinements", "~> 9.2"
    spec.add_dependency "runcom", "~> 8.2"
    spec.add_dependency "spek", "~> 0.2"
    spec.add_dependency "zeitwerk", "~> 2.5"
    spec.bindir = "exe"
    spec.executables << "demo"
    spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
    spec.files = Dir["*.gemspec", "lib/**/*"]
    end
    https://www.alchemists.io/projects/gemsmith

    View Slide

  56. Gem::Specification.new do |spec|
    spec.name = "demo"
    spec.version = "0.0.0"
    spec.authors = ["Alchemists Engineering"]
    spec.email = ["[email protected]"]
    spec.homepage = "https://www.alchemists.io/projects/demo"
    spec.summary = "This is a demo gem."
    spec.license = "Nonstandard"
    spec.metadata = {
    "allowed_push_host" => "https://rubygems.pkg.github.com/alchemists",
    "bug_tracker_uri" => "https://github.com/alchemists/demo/issues",
    "changelog_uri" => "https://www.alchemists.io/projects/demo/versions",
    "documentation_uri" => "https://www.alchemists.io/projects/demo",
    "label" => "Demo",
    "source_code_uri" => "https://github.com/alchemists/demo"
    }
    spec.required_ruby_version = "~> 3.1"
    spec.add_dependency "auto_injector", "~> 0.4"
    spec.add_dependency "dry-container", "~> 0.9"
    spec.add_dependency "refinements", "~> 9.2"
    spec.add_dependency "runcom", "~> 8.2"
    spec.add_dependency "spek", "~> 0.2"
    spec.add_dependency "zeitwerk", "~> 2.5"
    spec.bindir = "exe"
    spec.executables << "demo"
    spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
    spec.files = Dir["*.gemspec", "lib/**/*"]
    end
    https://www.alchemists.io/projects/gemsmith
    ❗Only update when ready to release

    View Slide

  57. Gem::Specification.new do |spec|
    spec.name = "demo"
    spec.version = "0.0.0"
    spec.authors = ["Alchemists Engineering"]
    spec.email = ["[email protected]"]
    spec.homepage = "https://www.alchemists.io/projects/demo"
    spec.summary = "This is a demo gem."
    spec.license = "Nonstandard"
    spec.metadata = {
    "allowed_push_host" => "https://rubygems.pkg.github.com/alchemists",
    "bug_tracker_uri" => "https://github.com/alchemists/demo/issues",
    "changelog_uri" => "https://www.alchemists.io/projects/demo/versions",
    "documentation_uri" => "https://www.alchemists.io/projects/demo",
    "label" => "Demo",
    "source_code_uri" => "https://github.com/alchemists/demo"
    }
    spec.required_ruby_version = "~> 3.1"
    spec.add_dependency "auto_injector", "~> 0.4"
    spec.add_dependency "dry-container", "~> 0.9"
    spec.add_dependency "refinements", "~> 9.2"
    spec.add_dependency "runcom", "~> 8.2"
    spec.add_dependency "spek", "~> 0.2"
    spec.add_dependency "zeitwerk", "~> 2.5"
    spec.bindir = "exe"
    spec.executables << "demo"
    spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
    spec.files = Dir["*.gemspec", "lib/**/*"]
    end
    (also your gem credentials key)
    https://www.alchemists.io/projects/gemsmith

    View Slide

  58. View Slide

  59. View Slide

  60. View Slide

  61. Gem::Specification.new do |spec|
    spec.metadata = {
    "allowed_push_host" => "https://rubygems.pkg.github.com/alchemists"
    }
    end
    https://rubygems.pkg.github.com/alchemists: Bearer
    Gem Speci
    fi
    cation
    Gem Credentials

    View Slide

  62. https://docs.github.com/en/actions

    View Slide

  63. GitHub Actions
    https://docs.github.com/en/actions

    View Slide

  64. https://docs.github.com/en/actions

    View Slide

  65. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  66. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  67. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  68. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  69. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    Git Tags
    https://docs.github.com/en/actions

    View Slide

  70. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    Packages
    https://docs.github.com/en/actions

    View Slide

  71. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  72. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  73. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  74. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  75. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  76. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  77. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  78. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    https://docs.github.com/en/actions

    View Slide

  79. name: Gemsmith
    on:
    push:
    branches: main
    jobs:
    build:
    runs-on: ubuntu-latest
    container:
    image: ruby:latest
    permissions:
    contents: write
    packages: write
    steps:
    - name: Checkout
    uses: actions/[email protected]
    with:
    fetch-depth: '0'
    ref: ${{github.head_ref}}
    - name: Setup
    run: |
    git config user.email "[email protected]"
    git config user.name "Alchemists Publisher"
    mkdir -p $HOME/.gem
    printf "%s\n" "https://rubygems.pkg.github.com/alchemists: Bearer ${{secrets.GITHUB_TOKEN}}" > $HOME/.gem/credentials
    chmod 0600 $HOME/.gem/credentials
    - name: Install
    run: gem install gemsmith
    - name: Publish
    run: |
    if git describe --tags --abbrev=0 > /dev/null 2>&1; then
    gemsmith --publish
    else
    printf "%s\n" "First gem version must be manually created. Skipping."
    🎉
    https://docs.github.com/en/actions

    View Slide

  80. https://docs.github.com/en/actions

    View Slide

  81. https://docs.github.com/en/actions

    View Slide

  82. Debugging
    🐞
    https://docs.github.com/en/actions

    View Slide

  83. Debugging
    🐞
    https://docs.github.com/en/actions
    💩 💩
    💩

    View Slide

  84. https://docs.github.com/en/actions
    Additional Steps

    View Slide

  85. steps:
    - name: Environment
    uses: printenv | sort
    https://docs.github.com/en/actions
    Additional Steps

    View Slide

  86. steps:
    - name: Environment
    uses: printenv | sort
    https://docs.github.com/en/actions
    steps:
    - name: Debug
    uses:
    Additional Steps

    View Slide

  87. Act
    https://github.com/nektos/act

    View Slide

  88. Thanks
    https://www.alchemists.io

    View Slide

  89. Thanks
    🙇
    https://www.alchemists.io

    View Slide