Merge pull request #1269 from leather-wallet/chore/update-stacking-copy #1471
This file contains 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
name: Create version | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'dev' | |
tags-ignore: | |
- '**' | |
paths-ignore: | |
- '**/CHANGELOG.md' | |
- '**/package.json' | |
- '**/yarn.lock' | |
pull_request: | |
workflow_dispatch: | |
env: | |
STX_NETWORK: testnet | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Add required Linux dependencies | |
uses: ./.github/actions/linux-deps | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Cache node_modules | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
${{ runner.os }}-yarn | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
yarn | |
yarn add -ED @actions/core | |
- name: Lint code | |
run: yarn check:lint | |
- name: Check exact versions | |
uses: ./.github/actions/check-version-lock | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Add required Linux dependencies | |
uses: ./.github/actions/linux-deps | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Cache node_modules | |
id: cache | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
${{ runner.os }}-yarn | |
- name: Install packages | |
uses: nick-invision/retry@v2 | |
if: steps.cache.outputs.cache-hit != 'true' | |
with: | |
timeout_seconds: 600 | |
max_attempts: 3 | |
retry_on: error | |
command: yarn --frozen-lockfile | |
- name: Build prod | |
run: yarn build | |
- name: Run jest | |
run: yarn test | |
release: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
outputs: | |
new_release_published: ${{ steps.semantic.outputs.new_release_published }} | |
new_release_version: ${{ steps.semantic.outputs.new_release_version }} | |
needs: | |
- lint | |
- test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
# When successful, this step creates a version tag, triggering `publish-version.yml` | |
- name: Semantic Release | |
uses: cycjimmy/[email protected] | |
id: semantic | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
with: | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/git | |
- name: Create file with release notes | |
run: echo "${{ steps.semantic.outputs.new_release_notes }}" > release-notes.txt | |
- run: cat release-notes.txt | |
- name: Upload release notes | |
uses: actions/upload-artifact@v2 | |
with: | |
name: release-notes | |
path: release-notes.txt |