Update Release github pipeline to trigger automatically (#1757)
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 3804751..794fd33 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -2,6 +2,11 @@
name: Release
on:
workflow_dispatch:
+ push:
+ branches:
+ - main
+ paths:
+ - version.bzl
defaults:
run:
@@ -14,7 +19,7 @@
validation:
runs-on: ubuntu-20.04
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
# TODO: Unfortunately it's not obvious how to restrict `workflow_dispatch` to a particular branch
# so this step ensures releases are always done off of `main`.
- name: Ensure branch is 'main'
@@ -69,7 +74,7 @@
env:
TARGET: "x86_64-unknown-linux-musl"
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Install rust toolchains for host
run: |
# Detect the current version of rust
@@ -101,7 +106,7 @@
bazel ${BAZEL_STARTUP_FLAGS[@]} run //crate_universe/tools/cross_installer -- --target=${TARGET} --output="${OUTPUT_PATH}"
env:
TARGET: "${{ matrix.env.TARGET }}"
- - uses: actions/upload-artifact@v2
+ - uses: actions/upload-artifact@v3
with:
name: "${{ matrix.env.TARGET }}"
path: ${{ github.workspace }}/crate_universe/target/artifacts/${{ matrix.env.TARGET }}
@@ -110,8 +115,8 @@
needs: builds
runs-on: ubuntu-20.04
steps:
- - uses: actions/checkout@v2
- - uses: actions/download-artifact@v2
+ - uses: actions/checkout@v3
+ - uses: actions/download-artifact@v3
with:
path: ${{ github.workspace }}/crate_universe/target/artifacts
- name: Detect the current version
@@ -133,7 +138,7 @@
ARTIFACTS_DIR: ${{ github.workspace }}/crate_universe/target/artifacts
URL_PREFIX: https://github.com/${{ github.repository_owner }}/rules_rust/releases/download/${{ env.RELEASE_VERSION }}
# Upload the artifact in case creating a release fails so all artifacts can then be manually recovered.
- - uses: actions/upload-artifact@v2
+ - uses: actions/upload-artifact@v3
with:
name: "rules_rust.tar.gz"
path: ${{ github.workspace }}/.github/rules_rust.tar.gz