Skip to content

Commit

Permalink
CI release action
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-harding committed Mar 22, 2024
1 parent 4346e08 commit 95daa86
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 2 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Publish release

on:
workflow_dispatch:

permissions:
contents: write

jobs:
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Install Rust toolchain
run: rustup update

- name: Build
run: cargo build --profile ci

- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: neophyte-linux
path: target/release/neophyte
retention-days: 1

build-macos:
runs-on: macos-latest
timeout-minutes: 5

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Install Rust toolchain
run: rustup update

- name: Build
run: cargo build --profile ci

- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: neophyte-macos
path: target/release/neophyte
retention-days: 1

build-windows:
runs-on: windows-latest
timeout-minutes: 5

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true

- name: Install Rust toolchain
run: rustup update

- name: Build
run: cargo build --profile ci

- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: neophyte-windows.exe
path: target/release/neophyte.exe
retention-days: 1

create-release:
runs-on: ubuntu-latest
timeout-minutes: 5
needs:
- build-linux
- build-macos
- build-windows

steps:
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: neophyte-linux

- name: Download MacOS artifact
uses: actions/download-artifact@v4
with:
name: neophyte-macos

- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: neophyte-windows.exe

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
gh release create "$TAG" neophyte-linux neophyte-macos neophyte-windows.exe \
--verify-tag \
--title="${TAG}" \
--notes-from-tag
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "neophyte"
version = "0.2.3"
version = "0.2.4"
edition = "2021"
authors = ["Tim Harding"]
repository = "https://github.com/tim-harding/neophyte"
Expand Down Expand Up @@ -37,3 +37,9 @@ features = ["colors"]

[profile.dev]
opt-level = 1

[profile.ci]
inherits = "release"
strip = true
lto = true
codegen-units = 1

0 comments on commit 95daa86

Please sign in to comment.