mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 11:12:53 +08:00
Our current release process involves pushing two commits to `main` simultaneously. The first is tagged `beta`, and then the second begins the new `-latest` cycle for the next beta version. Since they're pushed together, GitHub only triggers a single 'push' event for the most recent commit. This commit updates the publish-assets workflow so that it's also triggered when the `beta` tag is attached to a new commit. That'll ensure that assets are built & published for that specific commit, which is accessible via the `beta` tag and the version-specific tags.
54 lines
1.9 KiB
YAML
Vendored
54 lines
1.9 KiB
YAML
Vendored
name: Publish Assets
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- stable
|
|
tags:
|
|
- beta
|
|
|
|
concurrency:
|
|
group: publish-assets-${{ format('{0}-{1}', github.run_number, github.job) }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
publish-assets:
|
|
if: github.repository == 'discourse/discourse'
|
|
runs-on: 'debian-12-8core'
|
|
container: discourse/discourse_test:release
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- name: Install gh cli
|
|
run: |
|
|
# https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt
|
|
(type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
|
|
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
|
|
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
|
|
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
|
|
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
|
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
|
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
|
&& sudo apt update \
|
|
&& sudo apt install gh -y
|
|
- name: Set working directory owner
|
|
run: chown root:root .
|
|
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Git
|
|
run: |
|
|
git config --global user.email "ci@ci.invalid"
|
|
git config --global user.name "Discourse CI"
|
|
|
|
- name: pnpm install
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: build and release assets
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.DISCOURSE_ASSETS_RELEASE_TOKEN }}
|
|
run: |
|
|
script/publish_built_assets.rb
|