This commit is contained in:
parent
c5136331b4
commit
8aa9809f6d
1 changed files with 54 additions and 0 deletions
54
.github/workflows/release.yml
vendored
Normal file
54
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
DL_DIR: /srv/breadway-dl
|
||||
ECOSYSTEM_DIR: /tmp/bread-ecosystem-ci
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: [self-hosted, hestia]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: build
|
||||
run: cargo build --release --locked
|
||||
|
||||
- name: prepare artifacts
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
PKG_DIR="${DL_DIR}/breadmon/${VERSION}"
|
||||
mkdir -p "${PKG_DIR}"
|
||||
cp "target/release/breadmon" "${PKG_DIR}/breadmon-x86_64"
|
||||
strip "${PKG_DIR}/breadmon-x86_64"
|
||||
sha256sum "${PKG_DIR}/breadmon-x86_64" | awk '{print $1}' \
|
||||
> "${PKG_DIR}/breadmon-x86_64.sha256"
|
||||
cp bakery.toml "${PKG_DIR}/bakery.toml"
|
||||
ln -sfn "${VERSION}" "${DL_DIR}/breadmon/latest"
|
||||
|
||||
- name: ensure bread-ecosystem
|
||||
run: |
|
||||
rm -rf "${ECOSYSTEM_DIR}"
|
||||
git clone https://github.com/Breadway/bread-ecosystem.git "${ECOSYSTEM_DIR}"
|
||||
|
||||
- name: regenerate index.json
|
||||
run: bash "${ECOSYSTEM_DIR}/scripts/gen-index.sh"
|
||||
|
||||
- name: upload to GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
PKG_DIR="${DL_DIR}/breadmon/${VERSION}"
|
||||
gh release create "${GITHUB_REF_NAME}" \
|
||||
--title "breadmon v${VERSION}" --generate-notes 2>/dev/null || true
|
||||
gh release upload "${GITHUB_REF_NAME}" \
|
||||
"${PKG_DIR}/breadmon-x86_64" \
|
||||
"${PKG_DIR}/breadmon-x86_64.sha256" \
|
||||
--clobber
|
||||
Loading…
Add table
Add a link
Reference in a new issue