From 21dd7a9ab62ba95280236bc20a2a6ed567815b75 Mon Sep 17 00:00:00 2001 From: Brendan Hay Date: Wed, 25 Nov 2020 15:33:52 +0100 Subject: [PATCH 1/3] build: split artefact upload into separate release workflow --- .github/workflows/build.yml | 45 +++-------------------------------- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28d4b19b3..ca821bc08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,11 +30,9 @@ # # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions -name: Build, test, and upload urbit release tarball +name: Build and test urbit binaries -on: - push: null - pull_request: null +on: [push, pull_request] jobs: urbit: @@ -57,7 +55,7 @@ jobs: - run: nix-build -A urbit --arg enableStatic true - - if: ${{ matrix.os == 'ubuntu-latest' }} + - if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }} run: nix-build -A urbit-tests haskell: @@ -81,40 +79,3 @@ jobs: - run: nix-build -A hs.urbit-king.components.exes.urbit-king --arg enableStatic true - run: nix-build -A hs-checks - run: nix-build shell.nix - - upload: - needs: [urbit, haskell] - strategy: - matrix: - include: - - { os: ubuntu-latest, system: x86_64-linux } - - { os: macos-latest, system: x86_64-darwin } - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v12 - - uses: cachix/cachix-action@v8 - with: - name: mars - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - uses: google-github-actions/setup-gcloud@v0.2.0 - with: - version: '290.0.1' - service_account_key: ${{ secrets.GCS_SERVICE_ACCOUNT_KEY }} - project_id: ${{ secrets.GCS_PROJECT }} - export_default_credentials: true - - - run: nix-build -A tarball - - - name: Run upload to bootstrap.urbit.org - run: | - version="$(cat ./pkg/urbit/version)" - system="$(nix eval --raw '(builtins.currentSystem)')" - target="gs://bootstrap.urbit.org/ci/urbit-v${version}-${system}-${GITHUB_SHA:0:9}.tgz" - - gsutil cp -n ./result "$target" - - echo "upload to $target complete." diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..97a3cf452 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Upload urbit release tarball + +on: [release] + +jobs: + upload: + strategy: + matrix: + include: + - { os: ubuntu-latest, system: x86_64-linux } + - { os: macos-latest, system: x86_64-darwin } + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - uses: cachix/install-nix-action@v12 + - uses: cachix/cachix-action@v8 + with: + name: mars + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - uses: google-github-actions/setup-gcloud@v0.2.0 + with: + version: '290.0.1' + service_account_key: ${{ secrets.GCS_SERVICE_ACCOUNT_KEY }} + project_id: ${{ secrets.GCS_PROJECT }} + export_default_credentials: true + + - run: nix-build -A tarball + + - name: Run upload to bootstrap.urbit.org + run: | + version="$(cat ./pkg/urbit/version)" + system="$(nix eval --raw '(builtins.currentSystem)')" + target="gs://bootstrap.urbit.org/ci/urbit-v${version}-${system}-${GITHUB_SHA:0:9}.tgz" + + gsutil cp -n ./result "$target" + + echo "upload to $target complete." From 08332993b33a77e65cd3ce0d42e318b5fdbf19cc Mon Sep 17 00:00:00 2001 From: Brendan Hay Date: Fri, 4 Dec 2020 08:59:49 +0100 Subject: [PATCH 2/3] build: ensuring correct workflow naming and static binary upload --- .github/workflows/build.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca821bc08..e3faf128d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ # # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions -name: Build and test urbit binaries +name: build on: [push, pull_request] @@ -55,7 +55,7 @@ jobs: - run: nix-build -A urbit --arg enableStatic true - - if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }} + - if: ${{ matrix.os == 'ubuntu-latest' }} run: nix-build -A urbit-tests haskell: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97a3cf452..1cce58ad7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Upload urbit release tarball +name: release on: [release] @@ -27,7 +27,7 @@ jobs: project_id: ${{ secrets.GCS_PROJECT }} export_default_credentials: true - - run: nix-build -A tarball + - run: nix-build -A tarball --arg enableStatic true - name: Run upload to bootstrap.urbit.org run: | From 7542ff141355975cf934c219fefd45e6be850c4f Mon Sep 17 00:00:00 2001 From: Brendan Hay Date: Fri, 4 Dec 2020 09:20:48 +0100 Subject: [PATCH 3/3] build: upload static tarballs when a new tag is pushed --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1cce58ad7..8295ee5a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,9 @@ name: release -on: [release] +on: + release: null + push: + tags: ['*'] jobs: upload: