mediamtx/.github/workflows/release.yml

105 lines
2.2 KiB
YAML
Raw Normal View History

2020-12-15 12:38:23 +00:00
name: release
on:
push:
tags:
- 'v*'
jobs:
binaries:
runs-on: ubuntu-22.04
2020-12-15 12:38:23 +00:00
steps:
- uses: actions/checkout@v3
2020-12-15 12:38:23 +00:00
- run: make binaries
2020-12-15 12:38:23 +00:00
- uses: actions/upload-artifact@v3
with:
name: binaries
path: binaries
github:
needs: binaries
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- 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;
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,
data: await fs.readFile(`./binaries/${name}`),
2020-12-15 12:38:23 +00:00
});
}
dockerhub:
needs: binaries
runs-on: ubuntu-22.04
2020-12-15 12:38:23 +00:00
steps:
- uses: actions/checkout@v3
2020-12-15 12:38:23 +00:00
- uses: actions/download-artifact@v3
with:
name: binaries
path: binaries
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
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:
needs: binaries
runs-on: ubuntu-22.04
2021-08-07 17:03:07 +00:00
steps:
- 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