Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test release workflow #3

Merged
merged 1 commit into from
Oct 18, 2024
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
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
Loading