Skip to content

Commit

Permalink
chore: Manually release.
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Nov 29, 2022
1 parent 5b7fb06 commit 8218c2a
Showing 1 changed file with 36 additions and 61 deletions.
97 changes: 36 additions & 61 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: Release build

on:
push:
branches:
- main
- develop
- next
workflow_dispatch:
tags:
- 'v2*next*'

jobs:
prepare:
Expand Down Expand Up @@ -36,68 +33,46 @@ jobs:

release:
name: release
needs: prepare
runs-on: ubuntu-latest
needs:
prepare
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v3
with:
name: webhook
path: artifacts
- uses: actions/download-artifact@v3
with:
name: runners
path: artifacts
- uses: actions/download-artifact@v3
with:
name: runner-binaries-syncer
path: artifacts

- name: Get installation token
uses: npalm/[email protected]
id: app-token
with:
appId: ${{ secrets.FOREST_RELEASER_APP_ID }}
appPrivateKeyBase64: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
appInstallationType: repo
appInstallationValue: ${{ github.repository }}

- name: Dry run release
if: github.event_name != 'pull_request'
- name: Checkout code
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Read only token
run: |
cp .release/* .
yarn
yarn release -d --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Next release
draft: true
prerelease: false

- name: Release
if: (github.event_name != 'pull_request' && contains('refs/heads/main', github.ref))
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
cp .release/* .
yarn
yarn release --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git
assets:
name: upload assets
needs: release
runs-on: ubuntu-latest

provenance:
name: Generate provenance
runs-on: ubuntu-20.04
needs:
release
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
asset: ["webhook", "runner-binaries-syncer", "runners"]

steps:
- name: Generate provenance for release
uses: philips-labs/[email protected]
- uses: actions/download-artifact@v3
with:
artifact_path: release-assets
output_path: 'build.provenance'
tag_name: "${{ github.ref_name }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: ${{ matrix.asset }}
path: artifacts

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: artifacts/${{ matrix.asset }}.zip
asset_name: ${{ matrix.asset }}.zip
asset_content_type: application/zip

0 comments on commit 8218c2a

Please sign in to comment.