Merge pull request #327 from oasisprotocol/lj/stable/release-1.1.6 #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # NOTE: This name appears in GitHub's Checks API and in workflow's status badge. | |
| name: release | |
| # Trigger the workflow when: | |
| on: | |
| # A push occurs to one of the matched tags. | |
| push: | |
| tags: | |
| # Pattern that roughly matches Oasis Core's version tags. | |
| # For more details on GitHub Actions' pattern match syntax, see: | |
| # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags. | |
| - 'v[0-9]+.[0-9]+*' | |
| jobs: | |
| release: | |
| # NOTE: This name appears in GitHub's Checks API. | |
| name: prepare-release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| - uses: pnpm/action-setup@v3 | |
| name: Install pnpm | |
| with: | |
| version: 8 | |
| run_install: false | |
| - name: Set workflow variables | |
| # Id is needed to access output in a next step. | |
| id: vars | |
| env: | |
| # There's no support for escaping this for use in a shell command. | |
| # GitHub's recommendation is to pass it through the environment. | |
| # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable | |
| REF_NAME: ${{ github.ref_name }} | |
| # We want to show version without the leading 'v' | |
| # and use short SHA of the commit for file name. | |
| run: | | |
| echo "PNPM_CACHE_DIR=$(pnpm store path)" >> "$GITHUB_OUTPUT" | |
| echo "VERSION=$(echo "$REF_NAME" | sed 's/^v//')" >> "$GITHUB_OUTPUT" | |
| - uses: actions/cache@v3 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ steps.vars.outputs.PNPM_CACHE_DIR }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Build subcall lib | |
| run: pnpm --filter @oasisprotocol/rose-app-subcall build | |
| - name: Build app | |
| run: pnpm build | |
| - name: Create zip file | |
| env: | |
| # Need to escape again | |
| VERSION: ${{ steps.vars.outputs.VERSION }} | |
| run: | | |
| cd ./home/dist/ | |
| zip -r "../../rose-app-$VERSION.zip" . | |
| - name: Parse CHANGELOG.md file and extract changes for the given version | |
| uses: buberdds/extract-changelog-action@v1 | |
| id: changelog | |
| with: | |
| version: ${{ steps.vars.outputs.VERSION }} | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| rose-app-${{ steps.vars.outputs.VERSION }}.zip | |
| name: ROSE App ${{ steps.vars.outputs.VERSION }} | |
| body: ${{ steps.changelog.outputs.content }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |