Skip to content

Commit

Permalink
chore: prepare for v3
Browse files Browse the repository at this point in the history
Changes made in this commit:

- Now use yarn as a package manager rather than npm.

- Update all dependencies to their respective latest version.

- Fix build errors with latest dependencies and latest TypeScript.

- Configure ESLint to use semicolons.
  • Loading branch information
thunder-coding committed Apr 28, 2022
1 parent 1d71c23 commit d050566
Show file tree
Hide file tree
Showing 14 changed files with 13,703 additions and 20,335 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"semi": 2,
"@typescript-eslint/semi": 2,
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
Expand Down
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/ci.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/versioning.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Upload files to a GitHub release [![GitHub Actions Workflow](https://github.com/svenstaro/upload-release-action/workflows/PR%20Checks/badge.svg)](https://github.com/svenstaro/upload-release-action/actions)
# Upload files to a GitHub release [![GitHub Actions Workflow](https://github.com/termux/upload-release-action/workflows/PR%20Checks/badge.svg)](https://github.com/termux/upload-release-action/actions)

This action allows you to select which files to upload to the just-tagged release.
It runs on all operating systems types offered by GitHub.
Expand Down Expand Up @@ -47,11 +47,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
uses: termux/upload-release-action@v3
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/mything
Expand Down Expand Up @@ -89,11 +89,11 @@ jobs:
asset_name: mything-macos-amd64

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: cargo build --release --locked
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
uses: termux/upload-release-action@v3
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
Expand All @@ -115,11 +115,11 @@ jobs:
name: Publish binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
uses: termux/upload-release-action@v3
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/my*
Expand All @@ -144,11 +144,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: cargo build --release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
uses: termux/upload-release-action@v3
with:
repo_name: owner/repository-name
# A personal access token for the GitHub repository in which the release will be created and edited.
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# This step reads a file from repo and use it for body of the release
# This works on any self-hosted runner OS
Expand All @@ -197,7 +197,7 @@ jobs:
echo "::set-output name=RELEASE_BODY::$r" # <--- Set environment variable
- name: Upload Binaries to Release
uses: svenstaro/upload-release-action@v2
uses: termux/upload-release-action@v3
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
Expand All @@ -217,4 +217,16 @@ To release this Action:
- `git commit -am <version>`
- `git tag -sm <version> <version>`
- `git push --follow-tags`
- Go to https://github.com/svenstaro/upload-release-action/releases and publish the new version
- Go to https://github.com/termux/upload-release-action/releases and publish the new version

# Credits

Original author of the project: [@svenstaro](https://github.com/svenstaro)

## Why creating this fork

- Upstream still used Node.js 12 which is now EOL.
- Various dependencies were highly outdated in upstream.
- I mostly see dep updates in git history without much changes at all to other parts of source code.
- I don't see upstream fixing this anytime soon.
- It's always better if all the CI actions' sharable jobs are in the control of organisation members. This helps in assuring that no malicious code is injected on the CI.
16 changes: 8 additions & 8 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as github from '@actions/github'
import * as main from '../src/main'
import * as github from '@actions/github';
import * as main from '../src/main';

// Frankly, tests would be entirely useless unless we can mock GitHub somehow.
describe('Upload Release Action', () => {
let spyGetOctokit: jest.SpyInstance<any>
let mockOctokit: any
let spyGetOctokit: jest.SpyInstance<any>;
let mockOctokit: any;

beforeEach(() => {
mockOctokit = {
Expand All @@ -16,10 +16,10 @@ describe('Upload Release Action', () => {
}
}))
}
}
};
// spyGetOctokit = jest.spyOn(github, "getOctokit").mockImplementation(() => mockOctokit
// jest.spyOn(github, "context", "get").mockImplementation(() => "testtest");
})
});

it('pls write actual test', async () => {})
})
it('pls write actual test', async () => {});
});
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Upload files to a GitHub release'
description: 'Upload files to a GitHub release (cross-platform)'
author: 'Sven-Hendrik Haase'
author: 'Termux Maintainers'
branding:
icon: archive
color: orange
Expand Down Expand Up @@ -32,5 +32,5 @@ outputs:
browser_download_url:
description: 'The publicly available URL of the asset.'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'

0 comments on commit d050566

Please sign in to comment.