@dougefresh/ci 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/defaults.d.ts +14 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +104 -0
- package/dist/defaults.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +126 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +9 -2
- package/src/defaults.ts +12 -0
- package/src/index.ts +10 -1
- package/src/types.ts +12 -0
- package/.checkov.yml +0 -7
- package/.env.example +0 -61
- package/.gitattributes +0 -3
- package/.github/actions/install-yq/action.yaml +0 -80
- package/.github/actions/install-yq/scripts/unixish.sh +0 -112
- package/.github/actions/install-yq/scripts/windowsish.ps1 +0 -99
- package/.github/actions/jobtaker/action.yml +0 -29
- package/.github/actions/rust-config/action.yml +0 -34
- package/.github/actions/rust-init/action.yml +0 -75
- package/.github/additional-prompt.md +0 -62
- package/.github/ci-configs/dummy.yml +0 -24
- package/.github/ci-configs/rust/ai.yml +0 -65
- package/.github/ci-configs/rust-default.yml +0 -115
- package/.github/ci-configs/test/01.yml +0 -9
- package/.github/dependabot.yml +0 -26
- package/.github/prompts/create-release-notes.prompt.md +0 -29
- package/.github/prompts/unit-test.prompt.md +0 -77
- package/.github/rust-ci.ts +0 -5
- package/.github/workflows/action-ci.yml +0 -39
- package/.github/workflows/action-review.yml +0 -57
- package/.github/workflows/dummy-release.yml +0 -32
- package/.github/workflows/dummy-test.yml +0 -16
- package/.github/workflows/pages.yml +0 -59
- package/.github/workflows/pr-review.yml +0 -59
- package/.github/workflows/release.yml +0 -36
- package/.github/workflows/rust-release.yml +0 -133
- package/.github/workflows/rust.yml +0 -247
- package/.node-version +0 -1
- package/AGENTS.md +0 -28
- package/Cargo.toml +0 -6
- package/action.yml +0 -50
- package/biome.json +0 -108
- package/bun.lock +0 -39
- package/docs/SUMMARY.md +0 -3
- package/docs/book.toml +0 -49
- package/docs/index.md +0 -32
- package/pre-commit +0 -2
- package/prompt-template.md +0 -180
- package/scripts/bump-version.ts +0 -16
- package/scripts/generate-rust.ts +0 -9
package/.github/dependabot.yml
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
updates:
|
|
3
|
-
- package-ecosystem: github-actions
|
|
4
|
-
directory: /
|
|
5
|
-
schedule:
|
|
6
|
-
interval: weekly
|
|
7
|
-
groups:
|
|
8
|
-
actions-minor:
|
|
9
|
-
update-types:
|
|
10
|
-
- minor
|
|
11
|
-
- patch
|
|
12
|
-
|
|
13
|
-
- package-ecosystem: npm
|
|
14
|
-
directory: /
|
|
15
|
-
schedule:
|
|
16
|
-
interval: weekly
|
|
17
|
-
groups:
|
|
18
|
-
npm-development:
|
|
19
|
-
dependency-type: development
|
|
20
|
-
update-types:
|
|
21
|
-
- minor
|
|
22
|
-
- patch
|
|
23
|
-
npm-production:
|
|
24
|
-
dependency-type: production
|
|
25
|
-
update-types:
|
|
26
|
-
- patch
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Create Release Notes
|
|
2
|
-
|
|
3
|
-
You are an expert technical writer tasked with creating release notes for updates to this repository. Your specific task
|
|
4
|
-
is to generate release notes that are clear, concise, and useful for developers and users of the project.
|
|
5
|
-
|
|
6
|
-
## Guidelines
|
|
7
|
-
|
|
8
|
-
Ensure you adhere to the following guidelines when creating release notes:
|
|
9
|
-
|
|
10
|
-
- Use a clear and consistent format for the release notes
|
|
11
|
-
- Include a summary of the changes made in the release
|
|
12
|
-
- Highlight any new features, improvements, or bugfixes
|
|
13
|
-
- If applicable, include instructions for upgrading or migrating to the new version
|
|
14
|
-
- Use technical language that is appropriate for the audience, but avoid jargon that may not be understood by all users
|
|
15
|
-
- Ensure that the release notes are easy to read and navigate
|
|
16
|
-
- Include relevant issue or PR numbers where applicable
|
|
17
|
-
- Use proper Markdown formatting
|
|
18
|
-
- Use code blocks for commands, configuration examples, or code changes
|
|
19
|
-
- Use note and warning callouts for important information
|
|
20
|
-
|
|
21
|
-
## Versioning
|
|
22
|
-
|
|
23
|
-
GitHub Actions are versioned using branch and tag names. The version in the project's `package.json` should reflect the
|
|
24
|
-
changes made in the codebase and follow [Semantic Versioning](https://semver.org/) principles. Depending on the nature
|
|
25
|
-
of the changes, please make sure to adjust the release notes accordingly:
|
|
26
|
-
|
|
27
|
-
- For **major** changes, include a detailed description of the breaking changes and how users can adapt to them
|
|
28
|
-
- For **minor** changes, highlight new features and improvements
|
|
29
|
-
- For **patch** changes, focus on bugfixes and minor improvements
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Create Unit Test(s)
|
|
2
|
-
|
|
3
|
-
You are an expert software engineer tasked with creating unit tests for the repository. Your specific task is to
|
|
4
|
-
generate unit tests that are clear, concise, and useful for developers working on the project.
|
|
5
|
-
|
|
6
|
-
## Guidelines
|
|
7
|
-
|
|
8
|
-
Ensure you adhere to the following guidelines when creating unit tests:
|
|
9
|
-
|
|
10
|
-
- Use a clear and consistent format for the unit tests
|
|
11
|
-
- Include a summary of the functionality being tested
|
|
12
|
-
- Use descriptive test names that clearly convey their purpose
|
|
13
|
-
- Ensure tests cover both the main path of success and edge cases
|
|
14
|
-
- Use proper assertions to validate the expected outcomes
|
|
15
|
-
- Use `jest` for writing and running tests
|
|
16
|
-
- Place unit tests in the `__tests__` directory
|
|
17
|
-
- Use fixtures for any necessary test data, placed in the `__fixtures__` directory
|
|
18
|
-
|
|
19
|
-
## Example
|
|
20
|
-
|
|
21
|
-
Use the following as an example of how to structure your unit tests:
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
/**
|
|
25
|
-
* Unit tests for the action's main functionality, src/main.ts
|
|
26
|
-
*/
|
|
27
|
-
import { jest } from '@jest/globals';
|
|
28
|
-
import * as core from '../__fixtures__/core.js';
|
|
29
|
-
import { wait } from '../__fixtures__/wait.js';
|
|
30
|
-
|
|
31
|
-
// Mocks should be declared before the module being tested is imported.
|
|
32
|
-
jest.unstable_mockModule('@actions/core', () => core);
|
|
33
|
-
jest.unstable_mockModule('../src/wait.js', () => ({ wait }));
|
|
34
|
-
|
|
35
|
-
// The module being tested should be imported dynamically. This ensures that the
|
|
36
|
-
// mocks are used in place of any actual dependencies.
|
|
37
|
-
const { run } = await import('../src/main.js');
|
|
38
|
-
|
|
39
|
-
describe('main.ts', () => {
|
|
40
|
-
beforeEach(() => {
|
|
41
|
-
// Set the action's inputs as return values from core.getInput().
|
|
42
|
-
core.getInput.mockImplementation(() => '500');
|
|
43
|
-
|
|
44
|
-
// Mock the wait function so that it does not actually wait.
|
|
45
|
-
wait.mockImplementation(() => Promise.resolve('done!'));
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
afterEach(() => {
|
|
49
|
-
jest.resetAllMocks();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('Sets the time output', async () => {
|
|
53
|
-
await run();
|
|
54
|
-
|
|
55
|
-
// Verify the time output was set.
|
|
56
|
-
expect(core.setOutput).toHaveBeenNthCalledWith(
|
|
57
|
-
1,
|
|
58
|
-
'time',
|
|
59
|
-
// Simple regex to match a time string in the format HH:MM:SS.
|
|
60
|
-
expect.stringMatching(/^\d{2}:\d{2}:\d{2}/),
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('Sets a failed status', async () => {
|
|
65
|
-
// Clear the getInput mock and return an invalid value.
|
|
66
|
-
core.getInput.mockClear().mockReturnValueOnce('this is not a number');
|
|
67
|
-
|
|
68
|
-
// Clear the wait mock and return a rejected promise.
|
|
69
|
-
wait.mockClear().mockRejectedValueOnce(new Error('milliseconds is not a number'));
|
|
70
|
-
|
|
71
|
-
await run();
|
|
72
|
-
|
|
73
|
-
// Verify that the action was marked as failed.
|
|
74
|
-
expect(core.setFailed).toHaveBeenNthCalledWith(1, 'milliseconds is not a number');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
```
|
package/.github/rust-ci.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
name: test
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
branches:
|
|
5
|
-
- main
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- main
|
|
9
|
-
permissions:
|
|
10
|
-
contents: read
|
|
11
|
-
jobs:
|
|
12
|
-
test-action:
|
|
13
|
-
name: Actions Test / ${{ matrix.os }}
|
|
14
|
-
runs-on: ${{ matrix.os }}
|
|
15
|
-
strategy:
|
|
16
|
-
fail-fast: false
|
|
17
|
-
matrix:
|
|
18
|
-
os:
|
|
19
|
-
- ${{ vars.RUNNER_ARM64 }}
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout
|
|
22
|
-
id: checkout
|
|
23
|
-
uses: actions/checkout@v6
|
|
24
|
-
- name: Test Local Action
|
|
25
|
-
id: test-action
|
|
26
|
-
uses: ./
|
|
27
|
-
- name: Print Output
|
|
28
|
-
id: output
|
|
29
|
-
shell: bash
|
|
30
|
-
run: |
|
|
31
|
-
echo '${{ steps.test-action.outputs.config }}' | jq .
|
|
32
|
-
packages="${{ fromJSON(steps.test-action.outputs.config).global.packages.Linux }}"
|
|
33
|
-
echo $packages
|
|
34
|
-
# pages="${{ fromJSON(steps.test-action.outputs.config).pages.mdbook.if }}"
|
|
35
|
-
|
|
36
|
-
# if [ "$pages" != "false" ]; then
|
|
37
|
-
# echo "pages should be false"
|
|
38
|
-
# exit 1
|
|
39
|
-
# fi
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
name: jobtaker
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
types: [opened, synchronize, ready_for_review, reopened]
|
|
5
|
-
permissions:
|
|
6
|
-
contents: read
|
|
7
|
-
checks: write
|
|
8
|
-
pull-requests: write
|
|
9
|
-
id-token: write
|
|
10
|
-
jobs:
|
|
11
|
-
config:
|
|
12
|
-
if: |
|
|
13
|
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
14
|
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
15
|
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@jobtaker')) ||
|
|
16
|
-
(contains(github.event.pull_request.labels.*.name, 'jobtaker')) ||
|
|
17
|
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker')))
|
|
18
|
-
runs-on: ${{ vars.RUNNER }}
|
|
19
|
-
name: generate config
|
|
20
|
-
outputs:
|
|
21
|
-
config: ${{ steps.config.outputs.config }}
|
|
22
|
-
steps:
|
|
23
|
-
- name: Validate ANTHROPIC_API_KEY
|
|
24
|
-
shell: bash
|
|
25
|
-
run: |
|
|
26
|
-
if [ -z "${{ secrets.ANTHROPIC_API_KEY }}" ]; then
|
|
27
|
-
exit 1
|
|
28
|
-
fi
|
|
29
|
-
- uses: actions/checkout@v6
|
|
30
|
-
- name: config
|
|
31
|
-
id: config
|
|
32
|
-
uses: ./.github/actions/rust-config
|
|
33
|
-
with:
|
|
34
|
-
arm64: ${{ vars.RUNNER_ARM64 }}
|
|
35
|
-
amd64: ${{ vars.RUNNER_AMD64 }}
|
|
36
|
-
git_token: ${{ github.token }}
|
|
37
|
-
|
|
38
|
-
jobtaker:
|
|
39
|
-
needs: [config]
|
|
40
|
-
if: |
|
|
41
|
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
42
|
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
43
|
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@jobtaker')) ||
|
|
44
|
-
(contains(github.event.pull_request.labels.*.name, 'jobtaker')) ||
|
|
45
|
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker')))
|
|
46
|
-
runs-on: ${{ vars.RUNNER }}
|
|
47
|
-
steps:
|
|
48
|
-
- uses: actions/checkout@v6
|
|
49
|
-
- name: checkout
|
|
50
|
-
uses: ./.github/actions/rust-init
|
|
51
|
-
with:
|
|
52
|
-
packages: ${{ toJSON(fromJSON(needs.config.outputs.config).global.packages) }}
|
|
53
|
-
- name: jobtaker
|
|
54
|
-
uses: ./.github/actions/jobtaker
|
|
55
|
-
with:
|
|
56
|
-
config: ${{ needs.config.outputs.config }}
|
|
57
|
-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: release
|
|
2
|
-
permissions:
|
|
3
|
-
contents: write
|
|
4
|
-
checks: write
|
|
5
|
-
on:
|
|
6
|
-
workflow_dispatch:
|
|
7
|
-
inputs:
|
|
8
|
-
version:
|
|
9
|
-
description: 'version to release'
|
|
10
|
-
required: true
|
|
11
|
-
type: choice
|
|
12
|
-
default: patch
|
|
13
|
-
options:
|
|
14
|
-
- patch
|
|
15
|
-
- rc
|
|
16
|
-
- minor
|
|
17
|
-
- beta
|
|
18
|
-
- alpha
|
|
19
|
-
- major
|
|
20
|
-
- release
|
|
21
|
-
runner:
|
|
22
|
-
description: 'Runner to use'
|
|
23
|
-
required: false
|
|
24
|
-
jobs:
|
|
25
|
-
releaser:
|
|
26
|
-
if: false
|
|
27
|
-
name: release
|
|
28
|
-
uses: ./.github/workflows/rust-release.yml
|
|
29
|
-
secrets: inherit
|
|
30
|
-
with:
|
|
31
|
-
version: ${{ inputs.version }}
|
|
32
|
-
package: 'dummy'
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
name: dummy
|
|
2
|
-
permissions:
|
|
3
|
-
contents: read
|
|
4
|
-
checks: write
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches: [main]
|
|
8
|
-
pull_request:
|
|
9
|
-
jobs:
|
|
10
|
-
verify:
|
|
11
|
-
if: true
|
|
12
|
-
name: dummy
|
|
13
|
-
uses: ./.github/workflows/rust.yml
|
|
14
|
-
secrets: inherit
|
|
15
|
-
with:
|
|
16
|
-
runner: ${{ vars.RUNNER }}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
name: Pages
|
|
2
|
-
permissions:
|
|
3
|
-
contents: write # To push a branch
|
|
4
|
-
pages: write # To push to a GitHub Pages site
|
|
5
|
-
id-token: write # To update the deployment status
|
|
6
|
-
on:
|
|
7
|
-
workflow_call:
|
|
8
|
-
inputs:
|
|
9
|
-
runner:
|
|
10
|
-
type: string
|
|
11
|
-
default: ${{ vars.RUNNER }}
|
|
12
|
-
required: false
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
config:
|
|
16
|
-
runs-on: ubicloud-standard-2
|
|
17
|
-
name: generate config
|
|
18
|
-
outputs:
|
|
19
|
-
config: ${{ steps.merge.outputs.config }}
|
|
20
|
-
steps:
|
|
21
|
-
- name: merge
|
|
22
|
-
id: merge
|
|
23
|
-
uses: dougefresh/ci/.github/actions/rust-config@main
|
|
24
|
-
with:
|
|
25
|
-
git_token: ${{ github.token }}
|
|
26
|
-
runner: ${{ inputs.runner }}
|
|
27
|
-
mdbook:
|
|
28
|
-
runs-on: ubicloud-standard-2
|
|
29
|
-
needs: ['config']
|
|
30
|
-
if: ${{ fromJSON(needs.config.outputs.config).pages.mdbook.if }}
|
|
31
|
-
steps:
|
|
32
|
-
- uses: actions/checkout@v6
|
|
33
|
-
with:
|
|
34
|
-
fetch-depth: 0
|
|
35
|
-
# - name: Install latest mdbook
|
|
36
|
-
# run: |
|
|
37
|
-
# tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
|
|
38
|
-
# url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-aarch64-unknown-linux-gnu.tar.gz"
|
|
39
|
-
# mkdir mdbook
|
|
40
|
-
# curl -sSL $url | tar -xz --directory=./mdbook
|
|
41
|
-
# echo `pwd`/mdbook >> $GITHUB_PATH
|
|
42
|
-
- uses: jontze/action-mdbook@v4
|
|
43
|
-
name: Install mdBook
|
|
44
|
-
with:
|
|
45
|
-
token: ${{secrets.GITHUB_TOKEN}}
|
|
46
|
-
- name: Build Book
|
|
47
|
-
run: |
|
|
48
|
-
cd ${{ fromJSON(needs.config.outputs.config).pages.mdbook.path }}
|
|
49
|
-
${{ fromJSON(needs.config.outputs.config).pages.mdbook.command }}
|
|
50
|
-
|
|
51
|
-
- name: Setup Pages
|
|
52
|
-
uses: actions/configure-pages@v5
|
|
53
|
-
- name: Upload artifact
|
|
54
|
-
uses: actions/upload-pages-artifact@v4
|
|
55
|
-
with:
|
|
56
|
-
path: ${{ fromJSON(needs.config.outputs.config).pages.mdbook.path }}/book
|
|
57
|
-
- name: Deploy to GitHub Pages
|
|
58
|
-
id: deployment
|
|
59
|
-
uses: actions/deploy-pages@v4
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
name: jobtaker
|
|
2
|
-
on:
|
|
3
|
-
workflow_call:
|
|
4
|
-
inputs:
|
|
5
|
-
action_ref:
|
|
6
|
-
description: 'Ref to use for dougefresh/ci actions'
|
|
7
|
-
type: string
|
|
8
|
-
default: 'main'
|
|
9
|
-
permissions:
|
|
10
|
-
contents: read
|
|
11
|
-
checks: write
|
|
12
|
-
pull-requests: write
|
|
13
|
-
id-token: write
|
|
14
|
-
jobs:
|
|
15
|
-
|
|
16
|
-
config:
|
|
17
|
-
if: |
|
|
18
|
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
19
|
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
20
|
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@jobtaker')) ||
|
|
21
|
-
(contains(github.event.pull_request.labels.*.name, 'jobtaker')) ||
|
|
22
|
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker')))
|
|
23
|
-
runs-on: ${{ inputs.runner || vars.RUNNER }}
|
|
24
|
-
name: generate config
|
|
25
|
-
outputs:
|
|
26
|
-
config: ${{ steps.config.outputs.config }}
|
|
27
|
-
steps:
|
|
28
|
-
- name: Validate ANTHROPIC_API_KEY
|
|
29
|
-
shell: bash
|
|
30
|
-
run: |
|
|
31
|
-
if [ -z "${{ secrets.ANTHROPIC_API_KEY }}" ]; then
|
|
32
|
-
exit 1
|
|
33
|
-
fi
|
|
34
|
-
- name: config
|
|
35
|
-
id: config
|
|
36
|
-
uses: dougefresh/ci/.github/actions/rust-config@main
|
|
37
|
-
with:
|
|
38
|
-
arm64: ${{ vars.RUNNER_ARM64 }}
|
|
39
|
-
amd64: ${{ vars.RUNNER_AMD64 }}
|
|
40
|
-
git_token: ${{ github.token }}
|
|
41
|
-
jobtaker:
|
|
42
|
-
needs: [config]
|
|
43
|
-
if: |
|
|
44
|
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
45
|
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@jobtaker')) ||
|
|
46
|
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@jobtaker')) ||
|
|
47
|
-
(contains(github.event.pull_request.labels.*.name, 'jobtaker')) ||
|
|
48
|
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker')))
|
|
49
|
-
runs-on: ${{ vars.RUNNER }}
|
|
50
|
-
steps:
|
|
51
|
-
- name: checkout
|
|
52
|
-
uses: dougefresh/ci/.github/actions/rust-init@main
|
|
53
|
-
with:
|
|
54
|
-
packages: ${{ toJSON(fromJSON(needs.config.outputs.config).global.packages) }}
|
|
55
|
-
- name: jobtaker
|
|
56
|
-
uses: dougefresh/ci/.github/actions/jobtaker@main
|
|
57
|
-
with:
|
|
58
|
-
config: ${{ needs.config.outputs.config }}
|
|
59
|
-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: ci lib release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
|
|
6
|
-
permissions:
|
|
7
|
-
contents: write
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
release:
|
|
11
|
-
runs-on: ${{ vars.RUNNER }}
|
|
12
|
-
permissions:
|
|
13
|
-
contents: write
|
|
14
|
-
packages: write
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v6
|
|
17
|
-
|
|
18
|
-
- uses: oven-sh/setup-bun@v2
|
|
19
|
-
|
|
20
|
-
- name: Configure npm registry
|
|
21
|
-
run: |
|
|
22
|
-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
|
|
23
|
-
- name: Build
|
|
24
|
-
run: bun install && bun run build
|
|
25
|
-
- name: Get version
|
|
26
|
-
id: version
|
|
27
|
-
run: echo "tag=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
|
|
28
|
-
# - name: Publish
|
|
29
|
-
# run: bun publish --access public
|
|
30
|
-
- name: Publish to npm
|
|
31
|
-
run: npm publish
|
|
32
|
-
- uses: softprops/action-gh-release@v2
|
|
33
|
-
name: publish
|
|
34
|
-
with:
|
|
35
|
-
tag_name: ${{ steps.version.outputs.tag }}
|
|
36
|
-
generate_release_notes: true
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
on:
|
|
3
|
-
workflow_call:
|
|
4
|
-
inputs:
|
|
5
|
-
version:
|
|
6
|
-
type: string
|
|
7
|
-
required: true
|
|
8
|
-
package:
|
|
9
|
-
type: string
|
|
10
|
-
required: true
|
|
11
|
-
cargo-release-args:
|
|
12
|
-
type: string
|
|
13
|
-
required: false
|
|
14
|
-
default: ''
|
|
15
|
-
jobs:
|
|
16
|
-
config:
|
|
17
|
-
runs-on: ${{ inputs.runner || vars.RUNNER }}
|
|
18
|
-
name: generate config
|
|
19
|
-
outputs:
|
|
20
|
-
config: ${{ steps.config.outputs.config }}
|
|
21
|
-
steps:
|
|
22
|
-
- name: config
|
|
23
|
-
id: config
|
|
24
|
-
uses: dougefresh/ci/.github/actions/rust-config@main
|
|
25
|
-
with:
|
|
26
|
-
arm64: ${{ vars.RUNNER_ARM64 }}
|
|
27
|
-
amd64: ${{ vars.RUNNER_AMD64 }}
|
|
28
|
-
# win: "windows-latest"
|
|
29
|
-
# mac: "macos-latest"
|
|
30
|
-
git_token: ${{ github.token }}
|
|
31
|
-
release:
|
|
32
|
-
needs: [config]
|
|
33
|
-
outputs:
|
|
34
|
-
tag: ${{ steps.release.outputs.tag }}
|
|
35
|
-
runs-on: ${{ vars.RUNNER }}
|
|
36
|
-
permissions:
|
|
37
|
-
contents: write
|
|
38
|
-
steps:
|
|
39
|
-
- name: Init
|
|
40
|
-
uses: dougefresh/ci/.github/actions/rust-init@main
|
|
41
|
-
with:
|
|
42
|
-
packages: ${{ toJSON(fromJSON(needs.config.outputs.config).global.packages) }}
|
|
43
|
-
- name: Install cargo-release
|
|
44
|
-
uses: taiki-e/install-action@v2
|
|
45
|
-
with:
|
|
46
|
-
tool: cargo-release
|
|
47
|
-
- name: Configure Git
|
|
48
|
-
run: |
|
|
49
|
-
git config --global user.name "github-actions[bot]"
|
|
50
|
-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
51
|
-
- name: Release
|
|
52
|
-
id: release
|
|
53
|
-
env:
|
|
54
|
-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
55
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
56
|
-
NO_PUBLISH: ${{ fromJSON(needs.config.outputs.config).release.cargoPublish && '' || '--no-publish' }}
|
|
57
|
-
run: |
|
|
58
|
-
cargo release \
|
|
59
|
-
--package ${{ inputs.package }} \
|
|
60
|
-
--execute \
|
|
61
|
-
--no-confirm ${NO_PUBLISH} \
|
|
62
|
-
${{ inputs.cargo-release-args }} ${{ inputs.version }}
|
|
63
|
-
|
|
64
|
-
TAG=$(git describe --tags --abbrev=0)
|
|
65
|
-
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
66
|
-
make_latest="true"
|
|
67
|
-
case ${{ inputs.version }} in
|
|
68
|
-
alpha|beta|rc)
|
|
69
|
-
make_latest="false"
|
|
70
|
-
prerelease="true"
|
|
71
|
-
;;
|
|
72
|
-
*)
|
|
73
|
-
make_latest="true"
|
|
74
|
-
prerelease="false"
|
|
75
|
-
;;
|
|
76
|
-
esac
|
|
77
|
-
echo "make_latest=$make_latest" >> $GITHUB_OUTPUT
|
|
78
|
-
echo "prerelease=$prerelease" >> $GITHUB_OUTPUT
|
|
79
|
-
- name: Create GitHub Release
|
|
80
|
-
uses: softprops/action-gh-release@v2
|
|
81
|
-
with:
|
|
82
|
-
tag_name: ${{ steps.release.outputs.tag }}
|
|
83
|
-
generate_release_notes: true
|
|
84
|
-
make_latest: ${{ steps.release.outputs.make_latest }}
|
|
85
|
-
prerelease: ${{ steps.release.outputs.prerelease == 'true' }}
|
|
86
|
-
bin:
|
|
87
|
-
name: assets / ${{ matrix.target }}
|
|
88
|
-
if: ${{ fromJSON(needs.config.outputs.config).release.bin }}
|
|
89
|
-
needs: [config, release]
|
|
90
|
-
strategy:
|
|
91
|
-
matrix:
|
|
92
|
-
include: ${{ fromJSON(toJSON(fromJSON(needs.config.outputs.config).release.os)) }}
|
|
93
|
-
runs-on: ${{ matrix.os }}
|
|
94
|
-
steps:
|
|
95
|
-
- name: Init / ${{ matrix.target }}
|
|
96
|
-
uses: dougefresh/ci/.github/actions/rust-init@main
|
|
97
|
-
with:
|
|
98
|
-
packages: ${{ toJSON(fromJSON(needs.config.outputs.config).global.packages) }}
|
|
99
|
-
ref: ${{ needs.release.outputs.tag }}
|
|
100
|
-
- name: Build / ${{ matrix.target }}
|
|
101
|
-
id: build
|
|
102
|
-
run: |
|
|
103
|
-
if [ ${{ fromJSON(needs.config.outputs.config).release.debian }} == "true" ] && [ "${RUNNER_OS}" != "macOS" ]; then
|
|
104
|
-
cargo install cargo-deb
|
|
105
|
-
cargo deb --target ${{ matrix.target }}
|
|
106
|
-
echo _dpkg="$(ls target/debian/*.deb)" >> $GITHUB_OUTPUT
|
|
107
|
-
else
|
|
108
|
-
cargo build --release --target ${{ matrix.target }}
|
|
109
|
-
fi
|
|
110
|
-
echo _bin=target/${{ matrix.target }}/release/${{ fromJSON(needs.config.outputs.config).release.bin }} >> $GITHUB_OUTPUT
|
|
111
|
-
- name: Package / ${{ matrix.target }}
|
|
112
|
-
run: |
|
|
113
|
-
tar czf ${{ steps.build.outputs._bin }}-${{ matrix.target }}.tar.gz ${{ steps.build.outputs._bin }}
|
|
114
|
-
sha256sum ${{ steps.build.outputs._bin }}-${{ matrix.target }}.tar.gz > ${{ steps.build.outputs._bin }}-${{ matrix.target }}.tar.gz.sha256
|
|
115
|
-
- name: Hash Deb / ${{ matrix.target }}
|
|
116
|
-
if: ${{ steps.build.outputs._dpkg }}
|
|
117
|
-
run: |
|
|
118
|
-
sha256sum ${{ steps.build.outputs._dpkg }} > ${{ steps.build.outputs._dpkg }}.sha256
|
|
119
|
-
- name: Upload / ${{ matrix.target }}
|
|
120
|
-
uses: softprops/action-gh-release@v2
|
|
121
|
-
with:
|
|
122
|
-
tag_name: ${{ needs.release.outputs.tag }}
|
|
123
|
-
files: |
|
|
124
|
-
${{ steps.build.outputs._bin }}-${{ matrix.target }}.tar.gz
|
|
125
|
-
${{ steps.build.outputs._bin }}-${{ matrix.target }}.tar.gz.sha256
|
|
126
|
-
- name: Deb Upload / ${{ matrix.target }}
|
|
127
|
-
if: ${{ steps.build.outputs._dpkg }}
|
|
128
|
-
uses: softprops/action-gh-release@v2
|
|
129
|
-
with:
|
|
130
|
-
tag_name: ${{ needs.release.outputs.tag }}
|
|
131
|
-
files: |
|
|
132
|
-
${{ steps.build.outputs._dpkg }}
|
|
133
|
-
${{ steps.build.outputs._dpkg }}.sha256
|