-
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.
Signed-off-by: dark0dave <[email protected]>
- Loading branch information
Showing
8 changed files
with
506 additions
and
268 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 |
---|---|---|
@@ -1,109 +1,109 @@ | ||
name: Build | ||
|
||
name: main | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
- "*" | ||
pull_request: | ||
jobs: | ||
build-linux: | ||
name: build-${{matrix.target}} | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
target: | ||
- aarch64-unknown-linux-gnu | ||
- x86_64-unknown-linux-gnu | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: taiki-e/install-action@cross | ||
- run: | | ||
export CROSS=1 | ||
scripts/build.sh mod_installer --release --target ${{matrix.target}} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: mod_installer-${{matrix.target}} | ||
path: | | ||
dist/bin/* | ||
LICENSE | ||
README.md | ||
if-no-files-found: error | ||
build-macos: | ||
name: build-${{matrix.target}} | ||
runs-on: macos-latest | ||
timeout-minutes: 5 | ||
- uses: actions/[email protected] | ||
with: | ||
set-safe-directory: true | ||
- uses: actions/setup-python@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: pre-commit/[email protected] | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
target: | ||
- x86_64-apple-darwin | ||
- aarch64-apple-darwin | ||
include: | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
suffix: '' | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
suffix: '' | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
suffix: .exe | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install minimal stable | ||
uses: actions-rs/toolchain@v1 | ||
- uses: actions/[email protected] | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
- run: rustup target add ${{matrix.target}} | ||
- run: scripts/build.sh mod_installer --release --target ${{matrix.target}} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: mod_installer-${{ matrix.target }} | ||
path: | | ||
dist/bin/* | ||
if-no-files-found: error | ||
build-windows: | ||
name: build-windows | ||
runs-on: windows-latest | ||
timeout-minutes: 5 | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
target: | ||
- x86_64-pc-windows-msvc | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install minimal stable | ||
uses: actions-rs/toolchain@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
- run: cargo build --release --target ${{matrix.target}} | ||
- uses: actions/upload-artifact@v3 | ||
command: build | ||
args: --release | ||
- name: Archive release artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: mod_installer-${{ matrix.target }} | ||
path: | | ||
target/${{matrix.target}}/release/mod_installer* | ||
if-no-files-found: error | ||
create-release: | ||
permissions: write-all | ||
needs: [build-windows, build-macos, build-linux] | ||
name: post_infinity-${{ matrix.target }}${{ matrix.suffix }} | ||
path: ./target/release/post_infinity${{ matrix.suffix }} | ||
release: | ||
needs: [build, pre-commit] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
tag_name: ${{ steps.get_tag.outputs.git_tag }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Generate a changelog | ||
uses: orhun/git-cliff-action@v2 | ||
id: git-cliff | ||
with: | ||
config: cliff.toml | ||
args: --verbose | ||
env: | ||
OUTPUT: CHANGELOG.md | ||
- name: Print the changelog | ||
run: cat "${{ steps.git-cliff.outputs.changelog }}" | ||
- name: Get the tag | ||
id: get_tag | ||
run: echo ::set-output name=git_tag::${GITHUB_REF/refs\/tags\//} | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: release/ | ||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
uses: ncipollo/release-action@v1.13.0 | ||
with: | ||
fail_on_unmatched_files: true | ||
files: release/* | ||
tag_name: ${{ steps.get_tag.outputs.git_tag }} | ||
generate_release_notes: true | ||
draft: ${{ startsWith(steps.get_tag.outputs.git_tag, 'nightly') != true }} | ||
bodyFile: ./CHANGELOG.md | ||
prerelease: ${{ startsWith(steps.get_tag.outputs.git_tag, 'nightly') }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
upload: | ||
needs: [release] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
suffix: '' | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
suffix: '' | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
suffix: .exe | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: post_infinity-${{ matrix.target }}${{ matrix.suffix }} | ||
- name: Upload Release Asset - ${{ matrix.os }} | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./post_infinity${{ matrix.suffix }} | ||
asset_name: post_infinity-${{ matrix.target }}${{ matrix.suffix }} | ||
asset_content_type: application/octet-stream | ||
|
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,109 @@ | ||
name: main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
pull_request: | ||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
set-safe-directory: true | ||
- uses: actions/setup-python@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: pre-commit/[email protected] | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
suffix: '' | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
suffix: '' | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
suffix: .exe | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
- name: Archive release artifacts | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: post_infinity-${{ matrix.target }}${{ matrix.suffix }} | ||
path: ./target/release/post_infinity${{ matrix.suffix }} | ||
release: | ||
needs: [build, pre-commit] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
tag_name: ${{ steps.get_tag.outputs.git_tag }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Generate a changelog | ||
uses: orhun/git-cliff-action@v2 | ||
id: git-cliff | ||
with: | ||
config: cliff.toml | ||
args: --verbose | ||
env: | ||
OUTPUT: CHANGELOG.md | ||
- name: Print the changelog | ||
run: cat "${{ steps.git-cliff.outputs.changelog }}" | ||
- name: Get the tag | ||
id: get_tag | ||
run: echo ::set-output name=git_tag::${GITHUB_REF/refs\/tags\//} | ||
- name: Create Release | ||
id: create_release | ||
uses: ncipollo/[email protected] | ||
with: | ||
bodyFile: ./CHANGELOG.md | ||
prerelease: ${{ startsWith(steps.get_tag.outputs.git_tag, 'nightly') }} | ||
upload: | ||
needs: [release] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
suffix: '' | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
suffix: '' | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
suffix: .exe | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: post_infinity-${{ matrix.target }}${{ matrix.suffix }} | ||
- name: Upload Release Asset - ${{ matrix.os }} | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./post_infinity${{ matrix.suffix }} | ||
asset_name: post_infinity-${{ matrix.target }}${{ matrix.suffix }} | ||
asset_content_type: application/octet-stream | ||
|
Oops, something went wrong.