Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deploy CI #169

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 208 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
name: Gut Deploy

on:
push:
branches: [ master, feature/deploy ]
pull_request:
branches: [ master ]

jobs:
deploy-windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Divvun CI
uses: divvun/actions/setup@master
with:
key: ${{ secrets.DIVVUN_KEY }}

- name: Get version
id: version
uses: divvun/actions/version@master
with:
cargo: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install build dependencies
uses: divvun/actions/pahkat/init@master
with:
repo: https://pahkat.uit.no/devtools/
channel: nightly
packages: pahkat-uploader

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Build gut
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Create dist
run: |
mkdir -p dist/bin
mv target/release/gut.exe dist/bin/gut.exe

- name: Sign code
uses: divvun/actions/codesign@master
with:
path: dist/bin/gut.exe

- name: Create tarball package
id: installer
uses: divvun/actions/create-txz@master
with:
path: dist

- name: Deploy
uses: divvun/actions/deploy@master
with:
package-id: gut
type: TarballPackage
platform: windows
arch: x86_64
version: ${{ steps.version.outputs.version }}
payload-path: ${{ steps.installer.outputs['txz-path'] }}
repo: https://pahkat.thetc.se/devtools/
channel: ${{ steps.version.outputs.channel }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Divvun CI
uses: divvun/actions/setup@master
with:
key: ${{ secrets.DIVVUN_KEY }}

- name: Get version
id: version
uses: divvun/actions/version@master
with:
cargo: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install build dependencies
uses: divvun/actions/pahkat/init@master
with:
repo: https://pahkat.uit.no/devtools/
channel: nightly
packages: pahkat-uploader

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Build gut
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Create dist
run: |
strip target/release/gut
mkdir -p dist/bin
mv target/release/gut dist/bin/gut

- name: Sign code
uses: divvun/actions/codesign@master
with:
path: dist/bin/gut

- name: Create tarball package
id: installer
uses: divvun/actions/create-txz@master
with:
path: dist

- name: Deploy
uses: divvun/actions/deploy@master
with:
package-id: gut
type: TarballPackage
platform: macos
arch: x86_64
version: ${{ steps.version.outputs.version }}
payload-path: ${{ steps.installer.outputs['txz-path'] }}
repo: https://pahkat.thetc.se/devtools/
channel: ${{ steps.version.outputs.channel }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Divvun CI
uses: divvun/actions/setup@master
with:
key: ${{ secrets.DIVVUN_KEY }}

- name: Get version
id: version
uses: divvun/actions/version@master
with:
cargo: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install build dependencies
uses: divvun/actions/pahkat/init@master
with:
repo: https://pahkat.uit.no/devtools/
channel: nightly
packages: pahkat-uploader

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Build gut
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Create dist
run: |
strip target/release/gut
mkdir -p dist/bin
mv target/release/gut dist/bin/gut

- name: Create tarball package
id: installer
uses: divvun/actions/create-txz@master
with:
path: dist

- name: Deploy
uses: divvun/actions/deploy@master
with:
package-id: gut
type: TarballPackage
platform: linux
arch: x86_64
version: ${{ steps.version.outputs.version }}
payload-path: ${{ steps.installer.outputs['txz-path'] }}
repo: https://pahkat.thetc.se/devtools/
channel: ${{ steps.version.outputs.channel }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}