Skip to content

Commit

Permalink
Merge pull request #3 from parnexcodes/test-release-workflow
Browse files Browse the repository at this point in the history
Test release workflow
  • Loading branch information
parnexcodes authored Oct 18, 2024
2 parents 126d77a + f1bf220 commit 1ba04fd
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 6 deletions.
62 changes: 57 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Build and Release Nimbus

on:
push:
branches: [main]
branches-ignore:
- main
pull_request:
branches: [main]
branches-ignore:
- main

jobs:
build:
Expand Down Expand Up @@ -33,16 +35,66 @@ jobs:
chmod +x build.sh
./build.sh
- name: Set Version
id: version
run: |
VERSION="v0.${{ github.run_number }}.$(echo ${{ github.sha }} | cut -c1-7)"
echo "::set-output name=version::$VERSION"
- name: Create Pre-release
if: github.ref != 'refs/heads/main'
uses: elgohr/Github-Release-Action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: Pre-release ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}
prerelease: true

- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ steps.version.outputs.version }} ./builds/nimbus-linux ./builds/nimbus-windows.exe
main-release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Build Nimbus
run: |
chmod +x build.sh
./build.sh
- name: Set Version
id: version
run: |
VERSION="v0.${{ github.run_number }}.$(echo ${{ github.sha }} | cut -c1-7)"
echo "::set-output name=version::$VERSION"
- name: Create Release
uses: elgohr/Github-Release-Action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: Release ${{ github.run_number }}
tag: v${{ github.run_number }}
title: Release ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}

- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload v${{ github.run_number }} ./builds/nimbus-linux ./builds/nimbus-windows.exe
gh release upload ${{ steps.version.outputs.version }} ./builds/nimbus-linux ./builds/nimbus-windows.exe
Binary file modified builds/nimbus-linux
Binary file not shown.
Binary file modified builds/nimbus-windows.exe
Binary file not shown.
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ async fn main() {
// Parse command-line arguments
let args = Args::parse();

info!("Starting file/folder upload tool");
info!("Starting nimbus");

println!("{}", r#"
_ _ _ _
| \ | (_) | |
| \| |_ _ __ ___ | |__ _ _ ___
| . ` | | '_ ` _ \| '_ \| | | / __|
| |\ | | | | | | | |_) | |_| \__ \
\_| \_/_|_| |_| |_|_.__/ \__,_|___/
"#.cyan());
println!("{}", "File/Folder Upload Tool".green().bold());
println!("Path: {}", args.path);
println!("Sites: {}", args.sites.join(", "));
Expand Down

0 comments on commit 1ba04fd

Please sign in to comment.