2020-12-15 12:38:23 +00:00
|
|
|
name: release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
jobs:
|
2023-06-07 10:35:31 +00:00
|
|
|
binaries:
|
2022-11-10 22:47:26 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-15 12:38:23 +00:00
|
|
|
|
|
|
|
steps:
|
2022-11-10 22:47:26 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-15 12:38:23 +00:00
|
|
|
|
2022-09-17 18:15:23 +00:00
|
|
|
- run: make binaries
|
2020-12-15 12:38:23 +00:00
|
|
|
|
2022-11-07 08:34:00 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: binaries
|
|
|
|
path: binaries
|
|
|
|
|
|
|
|
github:
|
2023-06-07 10:35:31 +00:00
|
|
|
needs: binaries
|
2022-11-10 22:47:26 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-11-07 08:34:00 +00:00
|
|
|
|
|
|
|
steps:
|
2022-11-10 22:47:26 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-11-07 08:34:00 +00:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: binaries
|
|
|
|
path: binaries
|
|
|
|
|
2022-07-23 12:21:55 +00:00
|
|
|
- uses: actions/github-script@v6
|
2020-12-15 12:38:23 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
script: |
|
|
|
|
const fs = require('fs').promises;
|
|
|
|
const { repo: { owner, repo } } = context;
|
|
|
|
|
2022-07-23 12:21:55 +00:00
|
|
|
const currentRelease = context.ref.split('/')[2];
|
|
|
|
|
2022-09-17 18:13:04 +00:00
|
|
|
const res = await github.rest.repos.createRelease({
|
2022-07-23 12:21:55 +00:00
|
|
|
owner,
|
|
|
|
repo,
|
|
|
|
tag_name: currentRelease,
|
|
|
|
name: currentRelease,
|
|
|
|
});
|
|
|
|
const release_id = res.data.id;
|
|
|
|
|
2022-09-17 18:15:23 +00:00
|
|
|
for (const name of await fs.readdir('./binaries/')) {
|
2022-07-23 12:21:55 +00:00
|
|
|
await github.rest.repos.uploadReleaseAsset({
|
2020-12-15 12:38:23 +00:00
|
|
|
owner,
|
|
|
|
repo,
|
2022-07-23 12:21:55 +00:00
|
|
|
release_id,
|
|
|
|
name,
|
2022-09-17 18:15:23 +00:00
|
|
|
data: await fs.readFile(`./binaries/${name}`),
|
2020-12-15 12:38:23 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
dockerhub:
|
2023-06-07 10:35:31 +00:00
|
|
|
needs: binaries
|
2022-11-10 22:47:26 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-15 12:38:23 +00:00
|
|
|
|
|
|
|
steps:
|
2022-11-10 22:47:26 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-15 12:38:23 +00:00
|
|
|
|
2022-11-07 08:34:00 +00:00
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: binaries
|
|
|
|
path: binaries
|
2022-11-03 20:44:53 +00:00
|
|
|
|
2020-12-15 12:38:23 +00:00
|
|
|
- run: make dockerhub
|
|
|
|
env:
|
|
|
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
2021-08-07 17:03:07 +00:00
|
|
|
|
2023-06-07 10:35:31 +00:00
|
|
|
dockerhub_legacy:
|
|
|
|
needs: dockerhub
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- run: make dockerhub-legacy
|
|
|
|
env:
|
|
|
|
DOCKER_USER_LEGACY: ${{ secrets.DOCKER_USER_LEGACY }}
|
|
|
|
DOCKER_PASSWORD_LEGACY: ${{ secrets.DOCKER_PASSWORD_LEGACY }}
|
|
|
|
|
2021-08-07 17:03:07 +00:00
|
|
|
apidocs:
|
2023-06-07 10:35:31 +00:00
|
|
|
needs: binaries
|
2022-11-10 22:47:26 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2021-08-07 17:03:07 +00:00
|
|
|
|
|
|
|
steps:
|
2022-11-10 22:47:26 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-08-07 17:03:07 +00:00
|
|
|
|
|
|
|
- run: make apidocs-gen
|
|
|
|
|
|
|
|
- run: mv apidocs/*.html apidocs/index.html
|
|
|
|
|
|
|
|
- uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./apidocs
|