Skip to content

Commit

Permalink
automatic release
Browse files Browse the repository at this point in the history
  • Loading branch information
actioninja committed Oct 5, 2022
1 parent 4d59268 commit eb3364a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ tab_width = 4

[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Make release when version tag is pushed

on:
push:
tags:
- v*

jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build windows release
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target x86_64-pc-windows-msvc
- name: Build linux release
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target x86_64-unknown-linux-gnu
- name: Create output folder
run: |
mkdir artifacts
- name: Copy to release artifact dir
run: |
cp target/x86_64-pc-windows-msvc/release/hypnagogic-cli.exe artifacts/hypnagogic.exe
cp target/x86_64-unknown-linux-gnu/release/hypnagogic-cli artifacts/hypnagogic
cp -r examples artifacts/examples
cp -r templates artifacts/templates
cp README.md artifacts/README.md
cp LICENSE.md artifacts/LICENSE.md
- name: Zip release artifacts
uses: vimtor/action-zip@v1
with:
files: artifacts/
dest: hypnagogic-full-package.zip
- name: Publish Release
uses: marvinpinto/action-automatic-release@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: |
hypnagogic-full-package.zip
artifacts/hypnagogic
artifacts/hypnagogic.exe

0 comments on commit eb3364a

Please sign in to comment.