Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 924df3d

Browse files
authored
Merge pull request #45 from ember-learn/remove-glitch
Remove glitch from release steps
2 parents b67a595 + 38b8e2f commit 924df3d

File tree

8 files changed

+57
-109
lines changed

8 files changed

+57
-109
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ name: CI
1212
jobs:
1313
build:
1414
name: Build
15-
runs-on: '${{ matrix.os }}'
15+
runs-on: "${{ matrix.os }}"
1616
strategy:
1717
matrix:
1818
include:
1919
- os: macos-latest
2020
target: aarch64-apple-darwin
21-
suffix: ''
21+
suffix: ""
2222
- os: macos-latest
2323
target: x86_64-apple-darwin
24-
suffix: ''
24+
suffix: ""
2525
- os: ubuntu-latest
2626
target: x86_64-unknown-linux-musl
27-
suffix: ''
27+
suffix: ""
2828
- os: ubuntu-latest
2929
target: x86_64-unknown-linux-gnu
30-
suffix: ''
30+
suffix: ""
3131
- os: windows-latest
3232
target: x86_64-pc-windows-msvc
3333
suffix: .exe
@@ -51,7 +51,7 @@ jobs:
5151
- name: Make binary executable
5252
run: chmod u+x ./target/${{ matrix.target }}/release/tool-new-release${{ matrix.suffix }}
5353
- name: Archive production artifacts
54-
uses: actions/upload-artifact@v2
54+
uses: actions/upload-artifact@v4
5555
with:
5656
name: tool-new-release-${{ matrix.target }}
5757
path: ./target/${{ matrix.target }}/release/tool-new-release${{ matrix.suffix }}

src/args.rs

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,38 @@
1-
use clap:: {
2-
Parser,
3-
Subcommand
4-
};
1+
use clap::{Parser, Subcommand};
52

63
#[derive(Debug, Parser)]
74
#[clap(author, version, about)]
8-
pub struct ReleaseArgs{
9-
#[clap(subcommand)]
10-
pub project: Project,
11-
12-
/// Run the deploy pipeline without actually deploying.
13-
/// Useful for understanding all the necessary steps, or when working on the pipeline itself.
14-
#[arg(long, global = true)]
15-
pub dry_run: bool,
5+
pub struct ReleaseArgs {
6+
#[clap(subcommand)]
7+
pub project: Project,
8+
9+
/// Run the deploy pipeline without actually deploying.
10+
/// Useful for understanding all the necessary steps, or when working on the pipeline itself.
11+
#[arg(long, global = true)]
12+
pub dry_run: bool,
1613
}
1714

1815
#[derive(Debug, Subcommand)]
1916
pub enum Project {
20-
/// Release the Guides guides.emberjs.com
21-
Guides,
22-
23-
/// Run algolia on the guides
24-
GuidesSearch,
17+
/// Release the Guides guides.emberjs.com
18+
Guides,
2519

26-
/// Release the API Docs api.emberjs.com
27-
ApiDocs,
20+
/// Run algolia on the guides
21+
GuidesSearch,
2822

29-
/// Prepare the release blog post on blog.emberjs.com
30-
BlogPost,
23+
/// Release the API Docs api.emberjs.com
24+
ApiDocs,
3125

32-
/// Update the Glitch project
33-
Glitch {
34-
/// Set this to be the version you're trying to release
35-
#[arg(long)]
36-
version: String,
37-
},
26+
/// Prepare the release blog post on blog.emberjs.com
27+
BlogPost,
3828

39-
/// Update details on wikipedia
40-
Wikipedia,
29+
/// Update details on wikipedia
30+
Wikipedia,
4131

42-
/// Update the reminder bot
43-
Bot {
44-
/// Set this to true if you're doing a major version release
45-
#[arg(long, global = true)]
46-
major_version: bool,
47-
},
48-
}
32+
/// Update the reminder bot
33+
Bot {
34+
/// Set this to true if you're doing a major version release
35+
#[arg(long, global = true)]
36+
major_version: bool,
37+
},
38+
}

src/git/add.rs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/git/commit.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/glitch/push.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
1-
use std::path::{PathBuf};
21
use crate::utils::prompt::{automated, yes_no};
3-
use std::fs;
42
use dirs;
3+
use std::fs;
4+
use std::path::PathBuf;
55

66
mod projects {
77
pub mod api;
88
pub mod blog_post;
99
pub mod bot;
10-
pub mod glitch;
1110
pub mod guides;
1211
pub mod wikipedia;
1312
}
14-
mod cli;
1513
mod args;
14+
mod cli;
1615

1716
use args::ReleaseArgs;
1817
use clap::Parser;
1918

2019
pub mod utils;
2120
mod git {
22-
pub mod add;
2321
pub mod clone;
24-
pub mod commit;
25-
pub mod push;
26-
}
27-
mod glitch {
2822
pub mod push;
2923
}
3024

@@ -34,7 +28,6 @@ fn get_project_name(project: &args::Project) -> &'static str {
3428
args::Project::GuidesSearch => "Guides",
3529
args::Project::ApiDocs => "ApiDocs",
3630
args::Project::BlogPost => "BlogPost",
37-
args::Project::Glitch { version: _ } => "Glitch",
3831
args::Project::Wikipedia => "Wikipedia",
3932
args::Project::Bot { major_version: _ } => "Bot",
4033
}
@@ -50,13 +43,22 @@ fn main() {
5043
dir.push(get_project_name(&args.project));
5144

5245
let dir = dir.as_path();
53-
54-
let local_dir = format!("~/tool-new-release-working-dir/{}", get_project_name(&args.project));
46+
47+
let local_dir = format!(
48+
"~/tool-new-release-working-dir/{}",
49+
get_project_name(&args.project)
50+
);
5551

5652
automated(format!("starting the process in the local dir {} now", local_dir).as_str());
5753

5854
if dir.exists() {
59-
if yes_no(format!("Working directory {} already exists, do you want to delete it? y/n", local_dir).as_str()) {
55+
if yes_no(
56+
format!(
57+
"Working directory {} already exists, do you want to delete it? y/n",
58+
local_dir
59+
)
60+
.as_str(),
61+
) {
6062
println!("Deleting now!");
6163
fs::remove_dir_all(dir).expect("could not delete working directory");
6264
fs::create_dir_all(dir).expect("Could not create working directory");
@@ -70,11 +72,10 @@ fn main() {
7072
args::Project::GuidesSearch => projects::guides::publish_algolia(dir, args.dry_run),
7173
args::Project::ApiDocs => projects::api::run(dir, args.dry_run),
7274
args::Project::BlogPost => projects::blog_post::run(),
73-
args::Project::Glitch { version } => projects::glitch::run(dir, args.dry_run, version),
7475
args::Project::Wikipedia => projects::wikipedia::run(),
7576
args::Project::Bot { major_version } => {
7677
let versions = crate::cli::ask_version(major_version);
7778
projects::bot::run(&versions.target)
78-
},
79+
}
7980
};
8081
}

src/projects/guides.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
use crate::utils::prompt::{automated, manual};
2-
use std::{path::Path, process};
32
use semver::{Version, VersionReq};
3+
use std::{path::Path, process};
44

55
pub fn run(dir: &Path, dry_run: bool) {
66
let npm_version_command = process::Command::new("node")
7-
.arg("--version")
8-
.output()
9-
.expect("Could not check node version");
7+
.arg("--version")
8+
.output()
9+
.expect("Could not check node version");
1010

1111
let stdout_result = String::from_utf8(npm_version_command.stdout).unwrap();
12-
1312
let req = VersionReq::parse(">=14.0.0").unwrap();
14-
1513
let version = Version::parse(&stdout_result[1..stdout_result.len()].trim()).unwrap();
1614

17-
if !req.matches(&version) {
18-
panic!("Guides can only be installed with node version 14 and above right now. you have {:?}", stdout_result)
15+
if !req.matches(&version) {
16+
panic!(
17+
"Guides can only be installed with node version 14 and above right now. you have {:?}",
18+
stdout_result
19+
)
1920
}
2021

2122
manual("Check for pending PRs: https://github.com/ember-learn/guides-source/pulls");
@@ -35,7 +36,6 @@ pub fn run(dir: &Path, dry_run: bool) {
3536
if !status.success() {
3637
panic!("npm install failed");
3738
}
38-
3939
}
4040

4141
automated("Creating new version of guides");

src/utils/op.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ pub fn read(path: &str) -> String {
6868
let output = op().args(&["read", path]).output().unwrap();
6969
String::from_utf8_lossy(&output.stdout).trim().to_string()
7070
}
71-
pub mod glitch {
72-
pub fn read() -> String {
73-
super::read("op://Ember Learning Team/Glitch/password")
74-
}
75-
}
7671

7772
pub mod api_docs {
7873
use std::collections::HashMap;

0 commit comments

Comments
 (0)