Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpeapsUnterstrichHD committed Sep 3, 2024
1 parent 8e5953a commit a6577a6
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 28 deletions.
Binary file added .DS_Store
Binary file not shown.
39 changes: 11 additions & 28 deletions .github/workflows/rust-release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
name: Build and Release Rust CLI
name: Build and Release Rust CLI - 1

permissions:
contents: write

on:
push:
tags:
- 'v*.*.*' # Trigger on tags that match this pattern, e.g., v1.0.0

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Extract version from Cargo.toml
id: extract_version
run: |
version=$(grep '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "version=$version" >> $GITHUB_ENV
- id: create-release
uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
needs: create-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: universal-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: dino_cli_game # Replace with your actual binary name(s)
target: ${{ matrix.target }}
tar: unix # Change as needed based on distribution preference
zip: windows # Change as needed based on distribution preference
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="v${{ env.version }}"
title="v${{ env.version }}"
description="created on $(date +%Y-%m-%d)"
gh release create "$tag" --title "$title" --notes "$description"
46 changes: 46 additions & 0 deletions .github/workflows/rust-release2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Release Rust CLI - 2

permissions:
contents: write

on:
push:
tags:
- 'v*.*.*' # Trigger on tags that match this pattern, e.g., v1.0.0

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract version from Cargo.toml
id: extract_version
run: |
version=$(grep '^version = ' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
echo "version=$version" >> $GITHUB_ENV
- id: create-release
uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
needs: create-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: universal-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: dino_cli_game # Replace with your actual binary name(s)
target: ${{ matrix.target }}
tar: unix # Change as needed based on distribution preference
zip: windows # Change as needed based on distribution preference
token: ${{ secrets.GITHUB_TOKEN }}
Binary file added dino_cli_game
Binary file not shown.
Binary file added dino_cli_game-universal-apple-darwin.tar.gz
Binary file not shown.

0 comments on commit a6577a6

Please sign in to comment.