Skip to content
Draft
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
9 changes: 2 additions & 7 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Changesets
# .changeset

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
This directory previously held changesets for the npm package `@godaddy/cli`. The project has been rewritten in Rust; this directory is retained for historical reference only. New releases are managed via git tags and GitHub Releases.
46 changes: 26 additions & 20 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
name: CICD
on:
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
- '*'

jobs:
cicd:
runs-on: ubuntu-latest
concurrency: ${{ github.workflow }}-${{ github.ref }}
defaults:
run:
working-directory: rust
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v6.0.5

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev build-essential python3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Setup Node.js
uses: actions/setup-node@v6.4.0
- name: Cache cargo
uses: actions/cache@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Install dependencies
run: pnpm install
- name: Check
run: cargo check

- name: Build CLI
run: pnpm run build
- name: Format
run: cargo fmt --check

- name: Type check
run: pnpm run check
- name: Lint
run: cargo clippy -- -D warnings

- name: Run tests
run: pnpm test
- name: Test
run: cargo test
64 changes: 16 additions & 48 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '19 21 * * 3'
Expand All @@ -24,44 +12,24 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
permissions:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
- name: Checkout repository
uses: actions/checkout@v4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: rust

#- run: |
# make bootstrap
# make release
- name: Build
run: cargo build
working-directory: rust

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
117 changes: 89 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,105 @@ name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}
tags:
- 'v*'

permissions:
id-token: write
contents: write
pull-requests: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact: godaddy
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
artifact: godaddy
cross: true
- target: x86_64-apple-darwin
os: macos-latest
artifact: godaddy
- target: aarch64-apple-darwin
os: macos-latest
artifact: godaddy
- target: x86_64-pc-windows-msvc
os: windows-latest
artifact: godaddy.exe
defaults:
run:
working-directory: rust
steps:
- name: Checkout Repo
uses: actions/checkout@v6.0.2
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.target }}-cargo-

- name: Install cross
if: matrix.cross == true
run: cargo install cross --locked

- name: Setup pnpm
uses: pnpm/action-setup@v6.0.5
- name: Build
shell: bash
run: |
if [ "${{ matrix.cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }}
else
cargo build --release --target ${{ matrix.target }}
fi

- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev build-essential python3
- name: Package
shell: bash
run: |
TAG=${GITHUB_REF#refs/tags/}
ARCHIVE="godaddy-${TAG}-${{ matrix.target }}"
mkdir dist
cp target/${{ matrix.target }}/release/${{ matrix.artifact }} dist/
cd dist
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
7z a "../${ARCHIVE}.zip" ${{ matrix.artifact }}
echo "ARCHIVE=${ARCHIVE}.zip" >> "$GITHUB_ENV"
else
tar czf "../${ARCHIVE}.tar.gz" ${{ matrix.artifact }}
echo "ARCHIVE=${ARCHIVE}.tar.gz" >> "$GITHUB_ENV"
fi

- name: Setup Node
uses: actions/setup-node@v6.4.0
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
node-version: "24"
cache: "pnpm"
name: ${{ matrix.target }}
path: rust/${{ env.ARCHIVE }}

- name: Install Dependencies
run: pnpm install --prefer-offline
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1.7.0
- name: Create release
uses: softprops/action-gh-release@v2
with:
version: pnpm run version
publish: pnpm publish --filter @godaddy/cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
files: artifacts/*
generate_release_notes: true
Loading
Loading