-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- release-* | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
rust-release: | ||
name: ${{ matrix.name }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, windows-latest] | ||
include: | ||
- os: macos-latest | ||
name: MacOS Binary 64-Bit | ||
target: x86_64-apple-darwin | ||
target2: aarch64-apple-darwin | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: 10.7 | ||
|
||
- os: windows-latest | ||
name: Windows Binary 64-Bit | ||
target: x86_64-pc-windows-msvc | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Add rustup default target | ||
run: rustup target add ${{ matrix.target }} | ||
|
||
- name: Add rustup Apple ARM64 target | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: rustup target add ${{ matrix.target2 }} | ||
|
||
- name: Build default target in release mode | ||
run: cargo build --release --target ${{ matrix.target }} --locked | ||
|
||
- name: Build Apple ARM64 target in release mode | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: cargo build --release --target ${{ matrix.target2 }} --locked | ||
|
||
- name: Get latest release version number | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Create zip file on Windows | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
choco install zip | ||
cd target/${{ matrix.target }}/release | ||
zip fmap-${{ steps.get_version.outputs.version }}-${{ matrix.target }}.zip fmap.exe | ||
cd ../../.. | ||
- name: Create tar.gz file on macOS | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: | | ||
chmod +x target/${{ matrix.target }}/release/fmap | ||
tar -zcf target/${{ matrix.target }}/release/fmap-${{ steps.get_version.outputs.version }}-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release fmap | ||
chmod +x target/${{ matrix.target2 }}/release/fmap | ||
tar -zcf target/${{ matrix.target2 }}/release/fmap-${{ steps.get_version.outputs.version }}-${{ matrix.target2 }}.tar.gz -C target/${{ matrix.target2 }}/release fmap | ||
- name: Upload release and assets to GitHub | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
release_name: fmap ${{ steps.get_version.outputs.version }} | ||
file_glob: true | ||
file: target/*/release/fmap-${{ steps.get_version.outputs.version }}-*.{zip,tar.gz} |