Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
one
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Jul 5, 2021
1 parent 3b16a4b commit 07e7425
Show file tree
Hide file tree
Showing 6 changed files with 667 additions and 67 deletions.
26 changes: 9 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
MIT License
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (c) 2021 deirn
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
0. You just DO WHAT THE FUCK YOU WANT TO.
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
# autojitpack
# autojitpack@v1

Automatically send a request to JitPack after every release to save some headache
I hate it when I update a dependency version and it failed to sync because JitPack still building the package.

## Example

You'd probably want to use this action on a [`release`][1] event.

```yaml
name: release
on:
push:
tags: "*"
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: badasintended/autojitpack@v1
with:
java-version: 1.8
- run: chmod +x gradlew
- run: ./gradlew build
- uses: actions/upload-artifact@v2
with:
path: "./build/libs/**.jar"
- uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./build/libs/*[0-9.].jar"]'
- uses: badasintended/autojitpack@v0
version: ${{ github.event.release.tag_name }}
```
## Inputs
### `version`

**Required: yes**
Current tag (or commit hash if you are that type of person.)
Unlike [`v0`][2] that use git ref and shitty regex to resolve the package,
now it requires you to manually input the version yourself.

### `timeout`

**Required: yesn't**
**Default: `-1`**
Amount of time in milisecond the request will wait to abort itself.
If set to `-1`, it'll wait for JitPack to finish building the package.
Or it'll timeout regardless, idk. Either way your user wont need to waste another click to resync your package.

[1]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release
[2]: https://github.com/badasintended/autojitpack/tree/v0
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
name: "autojitpack"
author: "deirn"
description: "Automatically send a request to JitPack after every release to save some headache"
inputs:
version:
description: "Released version"
required: true
timeout:
description: "Timeout for the request, set to -1 to disable timeout and wait for jitpack to finish building"
default: "-1"
required: false
branding:
icon: "at-sign"
color: "green"
Expand Down
59 changes: 33 additions & 26 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
module.exports =
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 582:
/***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => {

const core = __nccwpck_require__(576);
const github = __nccwpck_require__(842);
const https = __nccwpck_require__(211);

var version = github.context.ref.replace(/refs[/].*[/]/, "");

var url = "https://jitpack.io/com/github/" + github.context.repo.owner + "/" + github.context.repo.repo + "/" + version + "/build.log";

core.info("Sending request to " + url);

https.get(url, { timeout: 2000 });


/***/ }),

/***/ 117:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {

Expand Down Expand Up @@ -5921,8 +5902,9 @@ module.exports = require("zlib");;
/******/ // The require function
/******/ function __nccwpck_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand All @@ -5947,10 +5929,35 @@ module.exports = require("zlib");;
/************************************************************************/
/******/ /* webpack/runtime/compat */
/******/
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
/******/ // module exports must be returned from runtime so entry inlining is disabled
/******/ // startup
/******/ // Load entry module and return exports
/******/ return __nccwpck_require__(582);
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
const core = __nccwpck_require__(576);
const github = __nccwpck_require__(842);
const https = __nccwpck_require__(211);

try {
let version = core.getInput("version", { required: true });
let timeout = parseInt(core.getInput("timeout"));
if (timeout == -1) {
timeout = undefined;
}
let repo = github.context.repo;

let url = `https://jitpack.io/com/github/${repo.owner}/${repo.repo}/${version}/build.log`;

core.info("Sending request to " + url);

let req = https.get(url, { timeout: timeout });
req.on("timeout", () => req.destroy());
req.on("error", () => req.destroy());
} catch (error) {
core.setFailed(error.message);
}

})();

module.exports = __webpack_exports__;
/******/ })()
;
Loading

0 comments on commit 07e7425

Please sign in to comment.