Skip to content

Commit

Permalink
Workflows (#9)
Browse files Browse the repository at this point in the history
* Add test, prerelease and deploy prerelease workflows to calendar

* Note upstream version in readme and change versioning

* Update node engines versioning

* Fix linting, but also uncomment it in workflow

* Remove test workflow while linting and testing just fails
  • Loading branch information
mwalbeck authored Jul 28, 2022
1 parent 5656f11 commit 5dd0d25
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy Prerelease

on:
workflow_run:
workflows: [Prerelease]
types: [completed]

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_STAGING_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_STAGING_HOST_FINGERPRINT }}
config: |
Host *
HostKeyAlgorithms ssh-rsa-cert-v01@openssh.com,ssh-rsa
StrictHostKeyChecking yes
- name: Deploy using server side script
run: ssh -qT ${{ secrets.SSH_USER }}@${{ secrets.SSH_STAGING_HOST }}
54 changes: 54 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Prerelease

on:
release:
types: [prereleased]

env:
APP_NAME: adminly_calendar

jobs:
prerelease:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.APP_NAME }}

- name: Set up PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
tools: composer

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.2
id: versions
with:
path: ./${{ env.APP_NAME }}/
fallbackNode: "^14"
fallbackNpm: "^7"

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Build and create tarball
run: |
cd ${{ env.APP_NAME }}
make release
- name: Upload tarball to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.APP_NAME }}/build/${{ env.APP_NAME }}.tar.gz
asset_name: ${{ env.APP_NAME }}.tar.gz
tag: ${{ github.ref }}
overwrite: true
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# later. See the LICENSE file.

app_name=adminly_calendar
app_id=calendar
build_directory=$(CURDIR)/build
temp_build_directory=$(build_directory)/temp
build_tools_directory=$(CURDIR)/build/tools
Expand Down Expand Up @@ -102,7 +103,7 @@ build-tarball:
--exclude="Makefile" \
--exclude="package-lock.json" \
--exclude="package.json" \
../$(app_name)/ $(temp_build_directory)/$(app_name)
../$(app_name)/ $(temp_build_directory)/$(app_id)
tar czf $(build_directory)/$(app_name).tar.gz \
-C $(temp_build_directory) $(app_name)
-C $(temp_build_directory) $(app_id)

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Adminly Calendar

This is a fork of [Nextcloud Calendar](https://github.com/nextcloud/calendar)

Based on version 3.4.0
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* ☑️ Tasks! See tasks with a due date directly in the calendar
* 🙈 **We’re not reinventing the wheel!** Based on the great [c-dav library](https://github.com/nextcloud/cdav-library), [ical.js](https://github.com/mozilla-comm/ical.js) and [fullcalendar](https://github.com/fullcalendar/fullcalendar) libraries.
]]></description>
<version>103.4.0</version>
<version>100.2.0-alpha1</version>
<licence>agpl</licence>
<author>Anna Larch</author>
<author homepage="https://github.com/nextcloud/groupware">Nextcloud Groupware Team</author>
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
"build": "webpack --node-env production --progress",
"dev": "webpack --node-env development --progress",
"watch": "webpack --node-env development --progress --watch",
"lint": "eslint --ext .js,.vue src",
"lint:fix": "eslint --ext .js,.vue src --fix",
"stylelint": "stylelint src css",
"stylelint:fix": "stylelint src css --fix",
"eslint": "eslint --ext .js,.vue src",
"eslint:fix": "eslint --ext .js,.vue src --fix",
"stylelint": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue",
"stylelint:fix": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue --fix",
"prettier": "prettier --check .",
"prettier:fix": "prettier --write .",
"test": "jest",
"test:coverage": "jest --coverage"
},
Expand Down Expand Up @@ -80,8 +82,8 @@
"extends @nextcloud/browserslist-config"
],
"engines": {
"node": ">=14.0.0",
"npm": ">=7.0.0"
"node": "^14.0.0",
"npm": "^7.0.0"
},
"devDependencies": {
"@nextcloud/babel-config": "^1.0.0",
Expand Down

0 comments on commit 5dd0d25

Please sign in to comment.