Skip to content

Commit

Permalink
Stop running some release workflows on forks and update old URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed Feb 1, 2025
1 parent da96fff commit e70b589
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/.github/workflows/autopublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
publish:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
publish-libs:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 7 additions & 4 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:

jobs:
dist:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -138,6 +139,7 @@ jobs:
path: ./dist

dist-x86_64-unknown-linux-musl:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: dist (x86_64-unknown-linux-musl)
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -183,6 +185,7 @@ jobs:
path: ./dist

publish:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
needs: ["dist", "dist-x86_64-unknown-linux-musl"]
Expand Down Expand Up @@ -257,24 +260,24 @@ jobs:
working-directory: ./editors/code

- name: Publish Extension (Code Marketplace, release)
if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
# token from https://dev.azure.com/rust-analyzer/
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix

- name: Publish Extension (OpenVSX, release)
if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
timeout-minutes: 2

- name: Publish Extension (Code Marketplace, nightly)
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release

- name: Publish Extension (OpenVSX, nightly)
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
timeout-minutes: 2
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<img
src="https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/master/assets/logo-wide.svg"
src="https://raw.githubusercontent.com/rust-lang/rust-analyzer/master/assets/logo-wide.svg"
alt="rust-analyzer logo">
</p>

Expand Down
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/xtask/src/publish/notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,18 +549,18 @@ impl Macro {
}
"pr" => {
let pr = &self.target;
let url = format!("https://github.com/rust-analyzer/rust-analyzer/pull/{pr}");
let url = format!("https://github.com/rust-lang/rust-analyzer/pull/{pr}");
format!("[`#{pr}`]({url})")
}
"commit" => {
let hash = &self.target;
let short = &hash[0..7];
let url = format!("https://github.com/rust-analyzer/rust-analyzer/commit/{hash}");
let url = format!("https://github.com/rust-lang/rust-analyzer/commit/{hash}");
format!("[`{short}`]({url})")
}
"release" => {
let date = &self.target;
let url = format!("https://github.com/rust-analyzer/rust-analyzer/releases/{date}");
let url = format!("https://github.com/rust-lang/rust-analyzer/releases/{date}");
format!("[`{date}`]({url})")
}
_ => bail!("macro not supported: {name}"),
Expand Down
8 changes: 4 additions & 4 deletions src/tools/rust-analyzer/xtask/test_data/expected.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

Hello!

Commit: [`0123456`](https://github.com/rust-analyzer/rust-analyzer/commit/0123456789abcdef0123456789abcdef01234567) \
Release: [`2022-01-01`](https://github.com/rust-analyzer/rust-analyzer/releases/2022-01-01)
Commit: [`0123456`](https://github.com/rust-lang/rust-analyzer/commit/0123456789abcdef0123456789abcdef01234567) \
Release: [`2022-01-01`](https://github.com/rust-lang/rust-analyzer/releases/2022-01-01)

## New Features

- **BREAKING** [`#1111`](https://github.com/rust-analyzer/rust-analyzer/pull/1111) shortcut <kbd>ctrl</kbd>+<kbd>r</kbd>
- **BREAKING** [`#1111`](https://github.com/rust-lang/rust-analyzer/pull/1111) shortcut <kbd>ctrl</kbd>+<kbd>r</kbd>
- hyphen-prefixed list item
- nested list item
- `foo` -> `foofoo`
Expand Down Expand Up @@ -65,7 +65,7 @@ Release: [`2022-01-01`](https://github.com/rust-analyzer/rust-analyzer/releases/
- list item with an inline image
![](https://example.com/animation.gif)

The highlight of the month is probably [`#1111`](https://github.com/rust-analyzer/rust-analyzer/pull/1111).
The highlight of the month is probably [`#1111`](https://github.com/rust-lang/rust-analyzer/pull/1111).
See [online manual](https://example.com/manual) for more information.

```bash
Expand Down

0 comments on commit e70b589

Please sign in to comment.