Github Actions
This commit is contained in:
parent
1bf1d8ee42
commit
ce47bd3f48
58
.github/workflows/deploy_docs.yml
vendored
Normal file
58
.github/workflows/deploy_docs.yml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
name: Deploy docs
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
package-name:
|
||||
description: 'Package name'
|
||||
default: 'nyxx'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-docs:
|
||||
name: Build and upload docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Setup Dart Action
|
||||
uses: cedx/setup-dart@v2.3.0
|
||||
with:
|
||||
release-channel: dev
|
||||
|
||||
- name: Create temp docs dir
|
||||
run: mkdir /tmp/temp_docs
|
||||
|
||||
- name: Build nyxx docs
|
||||
working-directory: ./nyxx
|
||||
run: dartdoc --enable-experiment=non-nullable
|
||||
|
||||
- name: Move nyxx docs to shared directory
|
||||
working-directory: ./nyxx
|
||||
run: cp -R ./doc/api /tmp/temp_docs/nyxx
|
||||
|
||||
- name: Build nyxx.commander docs
|
||||
working-directory: ./nyxx.commander
|
||||
run: dartdoc --enable-experiment=non-nullable
|
||||
|
||||
- name: Move nyxx docs to shared directory
|
||||
working-directory: ./nyxx.commander
|
||||
run: cp -R ./doc/api /tmp/temp_docs/nyxx.commander
|
||||
|
||||
- name: Build nyxx.extensions docs
|
||||
working-directory: ./nyxx.extensions
|
||||
run: dartdoc --enable-experiment=non-nullable
|
||||
|
||||
- name: Move nyxx docs to shared directory
|
||||
working-directory: ./nyxx.extensions
|
||||
run: cp -R ./doc/api /tmp/temp_docs/nyxx.extensions
|
||||
|
||||
- name: GitHub Pages action
|
||||
uses: peaceiris/actions-gh-pages@v3.7.3
|
||||
with:
|
||||
github_token: ${{ secrets.ACCESS_TOKEN }}
|
||||
# personal_token: # optional
|
||||
publish_dir: /tmp/temp_docs
|
||||
destination_dir: ./
|
||||
user_name: l7ssha
|
||||
user_email: szymon@l7ssha.xyz
|
34
.github/workflows/publish.yml
vendored
Normal file
34
.github/workflows/publish.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: Deploy to pub
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
package-name:
|
||||
description: 'Package name'
|
||||
default: 'nyxx'
|
||||
required: true
|
||||
dry:
|
||||
description: 'True if dry run, or false to publish'
|
||||
default: 'true'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Setup Dart Action
|
||||
uses: cedx/setup-dart@v2.3.0
|
||||
with:
|
||||
release-channel: dev
|
||||
|
||||
- name: Publish
|
||||
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
|
||||
with:
|
||||
credential: ${{ secrets.CREDENTIAL_JSON }}
|
||||
package_directory: ${{ github.event.inputs.package-name }}
|
||||
flutter_package: false
|
||||
skip_test: true
|
||||
dry_run: true
|
114
.github/workflows/tests.yml
vendored
Normal file
114
.github/workflows/tests.yml
vendored
Normal file
|
@ -0,0 +1,114 @@
|
|||
name: Tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test-nyxx:
|
||||
name: Test main nyxx package
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
|
||||
steps:
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pub_cache
|
||||
key: ${{ runner.os }}
|
||||
|
||||
- name: Setup Dart Action
|
||||
uses: cedx/setup-dart@v2.3.0
|
||||
with:
|
||||
release-channel: dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./nyxx
|
||||
run: dart pub get
|
||||
|
||||
- name: Analyze project source
|
||||
working-directory: ./nyxx
|
||||
run: dart analyze
|
||||
|
||||
- name: Compile tests
|
||||
working-directory: ./nyxx/test
|
||||
run: dart2native --enable-experiment=non-nullable travis.dart
|
||||
|
||||
- name: Run tests
|
||||
working-directory: ./nyxx/test
|
||||
run: ./travis.exe
|
||||
|
||||
test-commander:
|
||||
name: Tests commander package
|
||||
needs: [test-nyxx]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
|
||||
steps:
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pub_cache
|
||||
key: ${{ runner.os }}
|
||||
|
||||
- name: Setup Dart Action
|
||||
uses: cedx/setup-dart@v2.3.0
|
||||
with:
|
||||
release-channel: dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./nyxx.commander
|
||||
run: dart pub get
|
||||
|
||||
- name: Analyze project source
|
||||
working-directory: ./nyxx.commander
|
||||
run: dart analyze
|
||||
|
||||
- name: Compile tests
|
||||
working-directory: ./nyxx.commander/test
|
||||
run: dart2native --enable-experiment=non-nullable commander-test.dart
|
||||
|
||||
- name: Run tests
|
||||
working-directory: ./nyxx.commander/test
|
||||
run: ./commander-test.exe
|
||||
|
||||
test-extensions:
|
||||
name: Tests extensions package
|
||||
needs: [test-commander]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
|
||||
steps:
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pub_cache
|
||||
key: ${{ runner.os }}
|
||||
|
||||
- name: Setup Dart Action
|
||||
uses: cedx/setup-dart@v2.3.0
|
||||
with:
|
||||
release-channel: dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./nyxx.extensions
|
||||
run: dart pub get
|
||||
|
||||
- name: Analyze project source
|
||||
working-directory: ./nyxx.extensions
|
||||
run: dart analyze
|
||||
|
||||
- name: Compile tests
|
||||
working-directory: ./nyxx.extensions/test
|
||||
run: dart2native --enable-experiment=non-nullable extensions-tests.dart
|
||||
|
||||
- name: Run tests
|
||||
working-directory: ./nyxx.extensions/test
|
||||
run: ./extensions-tests.exe
|
|
@ -1,5 +1,5 @@
|
|||
name: nyxx_commander
|
||||
version: 1.1.0
|
||||
version: 1.1.0-dev.1
|
||||
description: A Discord library for Dart.
|
||||
homepage: https://github.com/l7ssha/nyxx
|
||||
repository: https://github.com/l7ssha/nyxx
|
||||
|
@ -7,11 +7,11 @@ documentation: https://github.com/l7ssha/nyxx/wiki
|
|||
issue_tracker: https://github.com/l7ssha/nyxx/issue
|
||||
|
||||
environment:
|
||||
sdk: '>=2.10.0-110.0.dev <3.0.0'
|
||||
sdk: '>=2.12.0-51.0.dev <3.0.0'
|
||||
|
||||
dependencies:
|
||||
nyxx: "^1.0.0"
|
||||
logging: "^1.0.0-dev"
|
||||
nyxx: "^1.1.0-dev.1"
|
||||
logging: "^1.0.0-nullsafety.0"
|
||||
|
||||
dependency_overrides:
|
||||
http:
|
||||
|
@ -20,8 +20,5 @@ dependency_overrides:
|
|||
http_parser:
|
||||
git:
|
||||
url: git://github.com/dart-lang/http_parser.git
|
||||
logging:
|
||||
git:
|
||||
url: git://github.com/dart-lang/logging.git
|
||||
nyxx:
|
||||
path: "../nyxx"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: nyxx_extensions
|
||||
version: 1.1.0
|
||||
version: 1.1.0-dev.1
|
||||
description: Extensions for Nyxx library
|
||||
homepage: https://github.com/l7ssha/nyxx
|
||||
repository: https://github.com/l7ssha/nyxx
|
||||
|
@ -7,10 +7,10 @@ documentation: https://github.com/l7ssha/nyxx/wiki
|
|||
issue_tracker: https://github.com/l7ssha/nyxx/issue
|
||||
|
||||
environment:
|
||||
sdk: '>=2.10.0-110.0.dev <3.0.0'
|
||||
sdk: '>=2.12.0-51.0.dev <3.0.0'
|
||||
|
||||
dependencies:
|
||||
nyxx: "^1.0.0"
|
||||
nyxx: "^1.1.0-dev.1"
|
||||
http: "^0.13.0-nullsafety-dev"
|
||||
|
||||
dependency_overrides:
|
||||
|
@ -20,8 +20,5 @@ dependency_overrides:
|
|||
http_parser:
|
||||
git:
|
||||
url: git://github.com/dart-lang/http_parser.git
|
||||
logging:
|
||||
git:
|
||||
url: git://github.com/dart-lang/logging.git
|
||||
nyxx:
|
||||
path: "../nyxx"
|
||||
path: "../nyxx"
|
||||
|
|
|
@ -9,7 +9,7 @@ class ReplyBuilder implements Builder {
|
|||
ReplyBuilder(this.messageId);
|
||||
|
||||
/// Constructs message reply from given message
|
||||
factory ReplyBuilder.froMessage(Message message) =>
|
||||
factory ReplyBuilder.fromMessage(Message message) =>
|
||||
ReplyBuilder(message.id);
|
||||
|
||||
/// Constructs message reply from cacheable of message and channel
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: nyxx
|
||||
version: 1.1.0
|
||||
version: 1.1.0-dev.1
|
||||
description: A Discord library for Dart.
|
||||
homepage: https://github.com/l7ssha/nyxx
|
||||
repository: https://github.com/l7ssha/nyxx
|
||||
|
@ -7,20 +7,17 @@ documentation: https://github.com/l7ssha/nyxx/wiki
|
|||
issue_tracker: https://github.com/l7ssha/nyxx/issue
|
||||
|
||||
environment:
|
||||
sdk: '>=2.10.0-110.0.dev <3.0.0'
|
||||
sdk: '>=2.12.0-51.0.dev <3.0.0'
|
||||
|
||||
dependencies:
|
||||
logging: "^1.0.0-dev"
|
||||
path: "^1.8.0-nullsafety.2"
|
||||
logging: "^1.0.0-nullsafety.0"
|
||||
path: "^1.8.0-nullsafety.3"
|
||||
http: "^0.13.0-nullsafety-dev"
|
||||
|
||||
dependency_overrides:
|
||||
http:
|
||||
git:
|
||||
url: git://github.com/dart-lang/http.git
|
||||
logging:
|
||||
git:
|
||||
url: git://github.com/dart-lang/logging.git
|
||||
http_parser:
|
||||
git:
|
||||
url: git://github.com/dart-lang/http_parser.git
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import "dart:async";
|
||||
import "dart:io";
|
||||
|
||||
import 'package:http/http.dart';
|
||||
import "package:nyxx/nyxx.dart";
|
||||
|
||||
// Replacement for assert. Throws if [test] isn't true.
|
||||
|
@ -44,10 +43,10 @@ void main() {
|
|||
bot.onReady.listen((e) async {
|
||||
final channel = await bot.fetchChannel<TextGuildChannel>(Snowflake(422285619952222208));
|
||||
// test(channel != null, "Channel cannot be null");
|
||||
if (env["TRAVIS_BUILD_NUMBER"] != null) {
|
||||
if (env["GITHUB_RUN_NUMBER"] != null) {
|
||||
await channel.sendMessage(
|
||||
content:
|
||||
"Testing new Travis CI build `#${env['TRAVIS_BUILD_NUMBER']}` from commit `${env['TRAVIS_COMMIT']}` on branch `${env['TRAVIS_BRANCH']}` with Dart version: `${env['TRAVIS_DART_VERSION']}`");
|
||||
"Testing new build `#${env['GITHUB_RUN_NUMBER']}` (ID: `${env['GITHUB_RUN_ID']}`) from commit `${env['GITHUB_SHA']}` started by `${env['GITHUB_ACTOR']} `");
|
||||
} else {
|
||||
await channel.sendMessage(content: "Testing new local build");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue