Skip to content

Commit

Permalink
Add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBlue committed Sep 4, 2023
1 parent b94cccb commit b3fdbff
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Solution

on:
workflow_call:
inputs:
branch-postfix:
required: false
type: string

jobs:
build:
name: Build Oxide Solution
runs-on: windows-2022

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Increment Version
uses: action-pack/increment@v2
with:
name: "VERSION"
token: ${{ secrets.REPO_ACCESS_TOKEN }}

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Restore Packages
run: nuget restore Oxide.Rust.sln

- name: Build Solution
run: msbuild Oxide.Rust.sln -t:rebuild -property:Configuration=Release -property:Version=2.0.${{ vars.VERSION }}${{ inputs.branch-postfix }}

- name: Compress Bundles
run: |
cd src\bin\Bundle
7z a Oxide.Rust.zip Oxide.Rust\*
7z a Oxide.Rust-linux.zip Oxide.Rust-linux\*
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: src\bin\Bundle\Oxide.*.zip
25 changes: 25 additions & 0 deletions .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Upload Bundles to S3

on:
push:
branches-ignore:
- master

jobs:
build:
name: Run Build
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
branch-postfix: "-${{ github.ref_name }}"

deploy:
name: Deploy to S3
uses: OxideMod/Actions/.github/workflows/r2-publish.yml@main
needs: build
with:
generate-filehash: true
secrets:
CLOUDFLARE_R2_KEY: ${{ secrets.CLOUDFLARE_R2_KEY }}
CLOUDFLARE_R2_SECRET: ${{ secrets.CLOUDFLARE_R2_SECRET }}
CLOUDFLARE_R2_ENDPOINT: ${{ secrets.CLOUDFLARE_R2_ENDPOINT }}
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Create Release

on:
push:
branches:
- master

jobs:
build:
name: Run Build
uses: ./.github/workflows/build.yaml
secrets: inherit

release:
name: Create Release
runs-on: ubuntu-22.04
needs: build
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: artifacts

- name: Deploy to GitHub Releases
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/Oxide.*.zip
tag_name: 2.0.${{ vars.VERSION }}
fail_on_unmatched_files: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
See https://umod.org/games/rust for changes

0 comments on commit b3fdbff

Please sign in to comment.