init auto release project
This commit is contained in:
parent
e1c03de704
commit
2078da51c7
@ -20,21 +20,21 @@ inputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: ${{ inputs.registry }}/${{ gitea.repository }}
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ inputs.registry }}
|
||||
username: ${{ inputs.username }}
|
||||
password: ${{ inputs.password }}
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
# - uses: docker/metadata-action@v5
|
||||
# id: meta
|
||||
# with:
|
||||
# images: ${{ inputs.registry }}/${{ gitea.repository }}
|
||||
# - uses: docker/login-action@v3
|
||||
# with:
|
||||
# registry: ${{ inputs.registry }}
|
||||
# username: ${{ inputs.username }}
|
||||
# password: ${{ inputs.password }}
|
||||
# - uses: docker/build-push-action@v6
|
||||
# with:
|
||||
# context: .
|
||||
# push: true
|
||||
# tags: ${{ steps.meta.outputs.tags }}
|
||||
# labels: ${{ steps.meta.outputs.labels }}
|
||||
- uses: https://gitea.okami101.io/okami101/actions/release@main
|
||||
if: ${{ inputs.release == 'true' }}
|
||||
with:
|
||||
|
@ -10,12 +10,43 @@ async function run() {
|
||||
|
||||
const [owner, repo] = repository.split("/");
|
||||
|
||||
const gitea_client = new gitea.GiteaApi({
|
||||
const client = new gitea.GiteaApi({
|
||||
BASE: `https://${host}/api/v1`,
|
||||
WITH_CREDENTIALS: true,
|
||||
TOKEN: token,
|
||||
});
|
||||
|
||||
let release = await client.repository.repoGetReleaseByTag({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
tag: body.tag_name,
|
||||
});
|
||||
const release_id = release.id;
|
||||
let target_commitish = release.target_commitish;
|
||||
if (
|
||||
body.target_commitish &&
|
||||
body.target_commitish !== release.target_commitish
|
||||
) {
|
||||
console.log(
|
||||
`Updating commit from "${release.target_commitish}" to "${body.target_commitish}"`
|
||||
);
|
||||
}
|
||||
target_commitish = body.target_commitish;
|
||||
release = client.repository.repoEditRelease({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
id: release_id,
|
||||
body: {
|
||||
body: body.body || release.body,
|
||||
draft: body.draft !== undefined ? body.draft : release.draft,
|
||||
name: body.name || release.name,
|
||||
prerelease:
|
||||
body.prerelease !== undefined ? body.prerelease : release.prerelease,
|
||||
tag_name: body.tag_name || release.tag_name,
|
||||
target_commitish: target_commitish,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(`TEST ${host} ${token} ${repository} ${owner} ${repo}`);
|
||||
// console.log(`🎉 Release ready at ${response.html_url}`);
|
||||
} catch (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user