-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding initial build and release workflow * caching and auth json * using single quotes to escape json chars * generate cache * auto tag and cond action * dry run on tags and no release branch * remove dev branch
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
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,59 @@ | ||
name: build and release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "**" | ||
|
||
|
||
jobs: | ||
build_n_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: setup-node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
cache: 'npm' | ||
|
||
- name: install dependecies | ||
run: npm install | ||
|
||
- name: load auth_config.json | ||
run: echo '${{ secrets.AUTH_CONFIG }}' > src/auth_config.json | ||
|
||
- name: buid | ||
# skiping fail on warning for now | ||
run: CI=false npm run build | ||
|
||
- name: archive | ||
run: tar zvcf build.tgz build | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
release_branches: none | ||
pre_release_branches: main | ||
dry_run: ${{ startsWith(github.ref, 'refs/tags/') }} # dry run if tag and generate output | ||
|
||
- uses: haya14busa/action-cond@v1 | ||
id: condval | ||
with: | ||
cond: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
if_true: "${{ github.ref }}" | ||
if_false: "${{ steps.tag_version.outputs.new_tag }}" | ||
|
||
- name: Use conditional value | ||
run: echo "${{ steps.condval.outputs.value }}" | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: build.tgz | ||
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
tag_name: ${{ steps.condval.outputs.value }} |