diff --git a/.drone.yml b/.drone.yml index f4f2c9b..b71c574 100644 --- a/.drone.yml +++ b/.drone.yml @@ -55,11 +55,32 @@ steps: mv build/firmware.ino.bin build/firmware.bin fi - # --- 2. タグPush時(v*.*.*)に Gitea へリリース作成 & バイナリ添付 --- + # --- 2. flash.j-code.org/download へ成果物を公開 --- + # /publish はランナー設定(DRONE_RUNNER_VOLUMES)でホストの flash/download に紐付いている + # 公開先: /download/<リポジトリ名>/latest/ (ブランチPush時)、/download/<リポジトリ名>/<タグ>/ (タグ時) + - name: publish-to-flash + image: alpine:3 + commands: + - | + if [ "$DRONE_BUILD_EVENT" = "tag" ]; then + DEST="/publish/$DRONE_REPO_NAME/$DRONE_TAG" + else + DEST="/publish/$DRONE_REPO_NAME/latest" + fi + mkdir -p "$DEST" + cp build/bootloader.bin build/partitions.bin build/firmware.bin "$DEST/" + chmod -R a+rX "/publish/$DRONE_REPO_NAME" + echo "公開先: https://flash.j-code.org/download/${DEST#/publish/}/" + when: + event: + - push + - tag + + # --- 3. タグPush時(v*.*.*)に Gitea へリリース作成 & バイナリ添付 --- - name: release-to-gitea image: plugins/gitea-release settings: - base_url: https://gitea.j-code.org # あなたの Gitea の URL に変更してください + base_url: https://gitea.j-code.org api_key: from_secret: gitea_token # Drone Secrets に登録した Access Token files: