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
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: ci

on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby-version: ["3.1", "3.4"]
steps:
- uses: actions/checkout@v6
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- run: bundle exec rake
- run: cargo fmt --check
- run: cargo clippy --workspace --all-features --locked -- -D warnings

native-gems:
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: x86_64-linux
- os: ubuntu-24.04-arm
artifact: aarch64-linux
- os: macos-15-intel
artifact: x86_64-darwin
- os: macos-14
artifact: arm64-darwin
- os: windows-latest
artifact: x64-mingw-ucrt
steps:
- uses: actions/checkout@v6
- uses: oxidize-rb/actions/setup-ruby-and-rust@v1
with:
ruby-version: "3.1"
bundler-cache: true
- name: Check tag version
shell: bash
run: |
expected="${GITHUB_REF_NAME#v}"
actual="$(ruby -Ilib -r dotenvx/version -e 'print Dotenvx::VERSION')"
test "$actual" = "$expected"
- run: bundle exec rake package:native
- name: Test packaged gem
shell: bash
run: |
gem install --local --ignore-dependencies pkg/*.gem
ruby -e 'require "dotenvx"; abort unless Dotenvx::VERSION == ENV.fetch("GITHUB_REF_NAME").delete_prefix("v")'
- uses: actions/upload-artifact@v7
with:
name: gem-${{ matrix.artifact }}
path: pkg/*.gem

publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: native-gems
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v6
with:
pattern: gem-*
path: pkg
merge-multiple: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
- name: Configure RubyGems credentials
uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0
- name: Publish platform gems
run: |
for gem in pkg/*.gem; do
gem push "$gem"
done
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
/pkg/
/spec/reports/
/tmp/
/target/
/lib/dotenvx/dotenvx_native.bundle
/lib/dotenvx/dotenvx_native.dll
/lib/dotenvx/dotenvx_native.so
/ext/dotenvx/Makefile

# rspec failure tracking
.rspec_status
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [Unreleased](https://github.com/dotenvx/dotenvx-ruby/compare/v0.1.0...main)
## [Unreleased](https://github.com/dotenvx/dotenvx-ruby/compare/v4.0.0...main)

## [4.0.0](https://github.com/dotenvx/dotenvx-ruby/compare/v0.0.2...v4.0.0)

- Load plaintext and encrypted dotenv files through `dotenvx-primitives`.
- Bundle the Rust implementation as a Magnus native extension.
- Match the conventional Ruby dotenv loading, parsing, overwrite, and strict
missing-file APIs.
- Publish native `dotenvx` gems for Linux, macOS, and Windows from one tag.

## 0.1.0 and prior

Expand Down
Loading
Loading