-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adds instructions to build and run the web frontend/backend
- Loading branch information
Showing
6 changed files
with
254 additions
and
108 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
name: Releases | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
memcoin: | ||
name: release memcoin and .deb | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '>=1.18' | ||
|
||
- name: Install fpm | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install ruby-dev build-essential | ||
sudo gem install fpm -f | ||
- name: build artifacts | ||
# builds the binary and the .deb | ||
run: make deb | ||
|
||
- name: Publish release to aptly | ||
env: | ||
APTLY_USER: ${{ secrets.APTLY_USER }} | ||
APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
run: | | ||
./deb-package/upload-artifacts.sh deb-package/dist | ||
- name: Update artifacts to Github's release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
memcoin-* | ||
deb-package/dist/* | ||
backend: | ||
name: release the web backend | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./web/backend | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: | | ||
echo ::set-output name=version::$(echo ${GITHUB_REF/refs\/tags\//}) | ||
echo ::set-output name=version_file::web-backend-$(echo ${GITHUB_REF/refs\/tags\//} | tr . _) | ||
echo "::set-output name=shortsha::$(git rev-parse --short ${GITHUB_SHA})" | ||
echo "::set-output name=buildurl::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" | ||
echo "::set-output name=date::$(date +'%d/%m/%y %H:%M')" | ||
- name: install | ||
run: | | ||
npm install | ||
- name: transpile | ||
env: | ||
NODE_ENV: production | ||
run: | | ||
./node_modules/.bin/tsc --outDir ./build/ | ||
- name: Pack folder | ||
run: | | ||
npm prune --production | ||
mkdir ${{ steps.get_version.outputs.version_file }} | ||
cd ${{ steps.get_version.outputs.version_file }} | ||
cp -r ../build/* . | ||
cp -r ../node_modules . | ||
cp -r ../dbUtils.js . | ||
cp -r ../config.env.template . | ||
- name: Create tar.gz | ||
run: | | ||
tar -czvf ${{ steps.get_version.outputs.version_file }}.tar.gz ${{ steps.get_version.outputs.version_file }} | ||
- name: Upload release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: web/backend/${{ steps.get_version.outputs.version_file }}.tar.gz | ||
|
||
fontend: | ||
name: release the web frontend | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./web/frontend | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: | | ||
echo ::set-output name=version::$(echo ${GITHUB_REF/refs\/tags\//}) | ||
echo ::set-output name=version_file::web-frontend-$(echo ${GITHUB_REF/refs\/tags\//} | tr . _) | ||
echo "::set-output name=shortsha::$(git rev-parse --short ${GITHUB_SHA})" | ||
echo "::set-output name=buildurl::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" | ||
echo "::set-output name=date::$(date +'%d/%m/%y %H:%M')" | ||
- name: install | ||
run: | | ||
npm install | ||
- name: save config variables | ||
run: | | ||
echo "REACT_APP_VERSION=${{ steps.get_version.outputs.version }}" >> .env.production | ||
echo "REACT_APP_BUILD=${{ steps.get_version.outputs.shortsha }}" >> .env.production | ||
echo "REACT_APP_BUILD_TIME=${{ steps.get_version.outputs.date }}" >> .env.production | ||
- name: transpile | ||
env: | ||
NODE_ENV: production | ||
HTTPS: true | ||
BUILD_PATH: ./build/ | ||
CI: false | ||
run: | | ||
./node_modules/.bin/react-scripts build | ||
- name: Create tar.gz | ||
run: | | ||
tar -czvf ${{ steps.get_version.outputs.version_file }}.tar.gz ./build | ||
- name: Upload release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: web/frontend/${{ steps.get_version.outputs.version_file }}.tar.gz |
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
Oops, something went wrong.