Skip to content

Commit

Permalink
auto tag and cond action
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmaycon committed Aug 15, 2021
1 parent d145a2f commit 0a3ef7a
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,37 @@ jobs:
- name: install dependecies
run: npm install

# - name: load auth_config.json
# run: echo '${{ secrets.AUTH_CONFIG }}' > src/auth_config.json
- 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: buid
# skiping fail on warning for now
run: CI=false npm run build

# - name: archive
# run: tar zvcf build.tgz build
- name: archive
run: tar zvcf build.tgz build

# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# files: build.tgz
# prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Bump version and push tag
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pre_release_branches: main,build-and-release

- 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 }}

0 comments on commit 0a3ef7a

Please sign in to comment.