1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

ci: Do not run upload action on forks

This commit is contained in:
Frieder Bluemle 2021-09-21 15:17:23 +02:00 committed by Wez Furlong
parent 1ec7c3843d
commit 89e4d7b787
29 changed files with 34 additions and 1 deletions

View File

@ -143,6 +143,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
release-tag: "nightly" release-tag: "nightly"

View File

@ -90,6 +90,7 @@ jobs:
run: "mv ~/rpmbuild/RPMS/*/*.rpm ." run: "mv ~/rpmbuild/RPMS/*/*.rpm ."
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
prerelease: true prerelease: true

View File

@ -126,6 +126,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
release-tag: "nightly" release-tag: "nightly"

View File

@ -71,6 +71,7 @@ jobs:
run: "mv ~/rpmbuild/RPMS/*/*.rpm ." run: "mv ~/rpmbuild/RPMS/*/*.rpm ."
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
prerelease: true prerelease: true

View File

@ -119,6 +119,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz"
release-tag: "nightly" release-tag: "nightly"

View File

@ -68,6 +68,7 @@ jobs:
run: "bash ci/deploy.sh" run: "bash ci/deploy.sh"
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: | files: |
wezterm-*.deb wezterm-*.deb

View File

@ -119,6 +119,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz"
release-tag: "nightly" release-tag: "nightly"

View File

@ -68,6 +68,7 @@ jobs:
run: "bash ci/deploy.sh" run: "bash ci/deploy.sh"
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: | files: |
wezterm-*.deb wezterm-*.deb

View File

@ -136,6 +136,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz"
release-tag: "nightly" release-tag: "nightly"

View File

@ -87,6 +87,7 @@ jobs:
run: "bash ci/deploy.sh" run: "bash ci/deploy.sh"
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: | files: |
wezterm-*.deb wezterm-*.deb

View File

@ -112,6 +112,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
release-tag: "nightly" release-tag: "nightly"

View File

@ -65,6 +65,7 @@ jobs:
run: "mv ~/rpmbuild/RPMS/*/*.rpm ." run: "mv ~/rpmbuild/RPMS/*/*.rpm ."
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
prerelease: true prerelease: true

View File

@ -112,6 +112,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
release-tag: "nightly" release-tag: "nightly"

View File

@ -65,6 +65,7 @@ jobs:
run: "mv ~/rpmbuild/RPMS/*/*.rpm ." run: "mv ~/rpmbuild/RPMS/*/*.rpm ."
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
prerelease: true prerelease: true

View File

@ -112,6 +112,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
release-tag: "nightly" release-tag: "nightly"

View File

@ -65,6 +65,7 @@ jobs:
run: "mv ~/rpmbuild/RPMS/*/*.rpm ." run: "mv ~/rpmbuild/RPMS/*/*.rpm ."
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
prerelease: true prerelease: true

View File

@ -112,6 +112,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
release-tag: "nightly" release-tag: "nightly"

View File

@ -65,6 +65,7 @@ jobs:
run: "mv ~/rpmbuild/RPMS/*/*.rpm ." run: "mv ~/rpmbuild/RPMS/*/*.rpm ."
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.rpm" files: "wezterm-*.rpm"
prerelease: true prerelease: true

View File

@ -112,6 +112,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "WezTerm-*.zip" files: "WezTerm-*.zip"
release-tag: "nightly" release-tag: "nightly"

View File

@ -85,6 +85,7 @@ jobs:
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: "WezTerm-*.zip" files: "WezTerm-*.zip"
prerelease: true prerelease: true

View File

@ -119,6 +119,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz;*.AppImage;*.zsync" files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz;*.AppImage;*.zsync"
release-tag: "nightly" release-tag: "nightly"

View File

@ -68,6 +68,7 @@ jobs:
run: "bash ci/appimage.sh" run: "bash ci/appimage.sh"
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: | files: |
wezterm-*.deb wezterm-*.deb

View File

@ -105,6 +105,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz"
release-tag: "nightly" release-tag: "nightly"

View File

@ -62,6 +62,7 @@ jobs:
run: "bash ci/deploy.sh" run: "bash ci/deploy.sh"
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: | files: |
wezterm-*.deb wezterm-*.deb

View File

@ -119,6 +119,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz" files: "wezterm-*.deb;wezterm-*.xz;wezterm-*.tar.gz"
release-tag: "nightly" release-tag: "nightly"

View File

@ -68,6 +68,7 @@ jobs:
run: "bash ci/deploy.sh" run: "bash ci/deploy.sh"
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: | files: |
wezterm-*.deb wezterm-*.deb

View File

@ -85,6 +85,7 @@ jobs:
- name: "Upload to Nightly Release" - name: "Upload to Nightly Release"
uses: wez/upload-release-assets@releases/v1 uses: wez/upload-release-assets@releases/v1
if: github.event.repository.fork == false
with: with:
files: "WezTerm-*.zip;WezTerm-*.exe" files: "WezTerm-*.zip;WezTerm-*.exe"
release-tag: "nightly" release-tag: "nightly"

View File

@ -58,6 +58,7 @@ jobs:
run: "bash ci/deploy.sh" run: "bash ci/deploy.sh"
- name: "Upload to Tagged Release" - name: "Upload to Tagged Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: github.event.repository.fork == false
with: with:
files: | files: |
WezTerm-*.zip WezTerm-*.zip

View File

@ -47,15 +47,18 @@ class RunStep(Step):
class ActionStep(Step): class ActionStep(Step):
def __init__(self, name, action, params=None, env=None): def __init__(self, name, action, params=None, env=None, condition=None):
self.name = name self.name = name
self.action = action self.action = action
self.params = params self.params = params
self.env = env self.env = env
self.condition = condition
def render(self, f, env): def render(self, f, env):
f.write(f" - name: {yv(self.name)}\n") f.write(f" - name: {yv(self.name)}\n")
f.write(f" uses: {self.action}\n") f.write(f" uses: {self.action}\n")
if self.condition:
f.write(f" if: {self.condition}\n")
if self.params: if self.params:
f.write(" with:\n") f.write(" with:\n")
for k, v in self.params.items(): for k, v in self.params.items():
@ -372,6 +375,7 @@ cargo build --all --release""",
ActionStep( ActionStep(
"Upload to Nightly Release", "Upload to Nightly Release",
action="wez/upload-release-assets@releases/v1", action="wez/upload-release-assets@releases/v1",
condition="github.event.repository.fork == false",
params={ params={
"files": ";".join(patterns), "files": ";".join(patterns),
"release-tag": "nightly", "release-tag": "nightly",
@ -392,6 +396,7 @@ cargo build --all --release""",
ActionStep( ActionStep(
"Upload to Tagged Release", "Upload to Tagged Release",
action="softprops/action-gh-release@v1", action="softprops/action-gh-release@v1",
condition="github.event.repository.fork == false",
params={"files": "\n".join(patterns), "prerelease": True}, params={"files": "\n".join(patterns), "prerelease": True},
env={ env={
"GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}", "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}",