Skip to content

Create formassembly (#535) #364

Create formassembly (#535)

Create formassembly (#535) #364

Workflow file for this run

on:
push:
branches:
- main
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: set env
run: echo "TAG_NAME=$(date +'%Y%m%d%H%M')" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
- name: asdf_install
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install
run: npm ci
env:
AWS_DEFAULT_REGION: us-east-1
- name: Build
run: npm run build
- name: NPM package version bump
run: npm version patch --no-git-tag-version
- uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
with:
commit_message: "NPM package version bump"
- name: Publish to npm
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.TAG_NAME }}
body: Ghostery Tracker DB release for ${{ env.TAG_NAME }}
draft: false
prerelease: false
- name: Upload SQL
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.db
asset_name: trackerdb.db
asset_content_type: application/vnd.sqlite3
- name: Upload JSON
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.json
asset_name: trackerdb.json
asset_content_type: application/json
- name: Upload Engine
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.engine
asset_name: trackerdb.engine
asset_content_type: application/octet-stream
- name: Upload TXT
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.txt
asset_name: trackerdb.txt
asset_content_type: text/plain