Skip to content

Commit

Permalink
Migrate CI to Github actions (#6)
Browse files Browse the repository at this point in the history
* draft action workflows

* use macor runtime for tests as well

* update cach save key

* use checkout v4 to remove node warning

* Add name to the test job

* Update readme and checkout action version for release
  • Loading branch information
duksis authored May 29, 2024
1 parent 01713f7 commit ae0d55d
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 18 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
push:
tags:
- 'v*'

name: Create Release

jobs:
build:
name: Create Release
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: true
prerelease: false
- name: Build
run: sh scripts/package_dmg.sh
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/lock.dmg
asset_name: lock.dmg
asset_content_type: application/octet-stream
- name: Publish release
uses: StuYarrow/publish-release@v1.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.create_release.outputs.id }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Tests

on: push

jobs:
build:
name: Test
runs-on: macos-14

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
id: cache
with:
path: ./shellcheck-latest
key: ${{ runner.os }}-shellcheck

- name: Install shellcheck
if: steps.cache.outputs.cache-hit != 'true'
run: sh ./scripts/install_shellcheck.sh

- name: Execute shellcheck
run: ./shellcheck-latest/shellcheck Lock.app/Contents/MacOS/main.command scripts/*

- name: Save to cache
if: steps.cache.outputs.cache-hit != 'true'
id: cache-save
uses: actions/cache/save@v4
with:
path: ./shellcheck-latest
key: ${{ runner.os }}-shellcheck
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![logo](./assets/lock.iconset/icon_32x32.png) Lock.app [![Build Status](https://travis-ci.org/duksis/Lock.svg?branch=master)](https://travis-ci.org/duksis/Lock)
# ![logo](./assets/lock.iconset/icon_32x32.png) Lock.app [![Build Status](https://github.com/duksis/Lock/actions/workflows/test.yml/badge.svg)](https://github.com/duksis/Lock/actions/workflows/test.yml)

Locks your Mac

Expand Down

0 comments on commit ae0d55d

Please sign in to comment.