Skip to content

Commit

Permalink
Add GitHub Actions workflow for upstream release check
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleHuisman committed Apr 28, 2024
1 parent d7d8d02 commit 0157619
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check for upstream releases

on: [workflow_dispatch]

jobs:
check:
name: Check for upstream releases
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Rust toolchain
run: rustup toolchain install nightly --no-self-update --profile default

- name: Check for upstream releases
run: cargo -p scripts --bin upstream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_USER_NAME: github-actions[bot]
GIT_USER_EMAIL: github-actions[bot]@users.noreply.github.com
25 changes: 3 additions & 22 deletions scripts/src/bin/check.rs → scripts/src/bin/upstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,6 @@ use serde::{Deserialize, Serialize};
use strum::{Display, EnumString, VariantArray};
use tempfile::tempdir;

// #[derive(Clone, Copy, Debug, PartialEq, Eq)]
// enum Package {
// Core,
// Dom,
// Leptos,
// Utils,
// }

// impl Package {
// fn upstream(&self) -> UpstreamPackage {
// match self {
// Package::Core => UpstreamPackage::Core,
// Package::Dom => UpstreamPackage::Dom,
// Package::Leptos => UpstreamPackage::Vue,
// Package::Utils => UpstreamPackage::Utils,
// }
// }
// }

#[derive(
Clone,
Copy,
Expand Down Expand Up @@ -64,7 +45,7 @@ async fn main() -> Result<(), Box<dyn Error>> {

octocrab::initialise(
octocrab::OctocrabBuilder::new()
.personal_token(env::var("GITHUB_PERSONAL_ACCESS_TOKEN")?)
.personal_token(env::var("GITHUB_TOKEN")?)
.build()?,
);

Expand Down Expand Up @@ -272,8 +253,8 @@ async fn create_pull_request(

let message = format!("Update to upstream {}", new_tag);
let author = CommitAuthor {
name: env::var("GIT_AUTHOR_NAME")?,
email: env::var("GIT_AUTHOR_EMAIL")?,
name: env::var("GIT_USER_NAME")?,
email: env::var("GIT_USER_EMAIL")?,
date: None,
};

Expand Down

0 comments on commit 0157619

Please sign in to comment.