-
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: NoobforAl <58856931+NoobforAl@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
84 additions
and
29 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,5 +1,6 @@ | ||
/target | ||
.vscode | ||
.gitignore | ||
.git* | ||
README.md | ||
LICENSE | ||
LICENSE | ||
Dockerfile |
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,34 +1,79 @@ | ||
name: Rust App Build | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
compile-linux: | ||
name: Compile for Linux | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup | ||
run: cargo install -f cross | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Build-linux | ||
run: cross build --target x86_64-unknown-linux-gnu --release | ||
- name: Build Linux executable | ||
run: cargo build --release --target x86_64-unknown-linux-gnu | ||
|
||
- name: Build-win | ||
run: cross build --target x86_64-pc-windows-gnu --release | ||
- name: Archive executable | ||
run: tar -czvf app-linux.tar.gz target/x86_64-unknown-linux-gnu/release/app | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: app-linux | ||
path: app-linux.tar.gz | ||
|
||
compile-windows: | ||
name: Compile for Windows | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Build Windows executable | ||
run: cargo build --release --target x86_64-pc-windows-gnu | ||
|
||
- name: Archive executable | ||
run: 7z a app-windows.zip target/x86_64-pc-windows-gnu/release/app.exe | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: app-windows | ||
path: app-windows.zip | ||
|
||
compile-darwin: | ||
name: Compile for Darwin (macOS) | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Package Linux | ||
run: tar -czvf webscreen-linux-x86_64.tar.gz -C target/x86_64-unknown-linux-gnu/release/ webscreen | ||
- name: Build macOS executable | ||
run: cargo build --release --target x86_64-apple-darwin | ||
|
||
- name: Package Windows | ||
run: zip webscreen-windows-x86_64.zip target/x86_64-pc-windows-gnu/release/webscreen.exe | ||
- name: Archive executable | ||
run: zip -r app-darwin.zip target/x86_64-apple-darwin/release/app | ||
|
||
- name: Publish | ||
uses: ncipollo/release-action@v1 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
artifacts: webscreen-linux-x86_64.tar.gz,webscreen-windows-x86_64.zip | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: app-darwin | ||
path: app-darwin.zip |
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
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,10 +1,15 @@ | ||
FROM rust:1.70.0-alpine | ||
|
||
RUN apk update | ||
RUN apk add --no-cache chromium | ||
FROM rust:latest | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app/ | ||
RUN apt update | ||
RUN apt install -y chromium | ||
RUN apt upgrade -y | ||
|
||
COPY . /app | ||
|
||
RUN cargo build --release | ||
|
||
EXPOSE 8080 | ||
|
||
CMD [ "cargo", "run", "--", "--debug", "--run-server" ] |