forked from cradlepoint/sdk-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to get built apps to work with actions
- Loading branch information
1 parent
4fbb5d3
commit 2be3621
Showing
1 changed file
with
21 additions
and
17 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 |
---|---|---|
|
@@ -3,8 +3,6 @@ on: | |
push: | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
pull_request: | ||
branches: | ||
- master | ||
|
@@ -32,26 +30,32 @@ jobs: | |
./.github/workflows/csclient_compare.sh | ||
shell: bash | ||
- name: Run make build and clean | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
chmod +x ./.github/workflows/builds.sh | ||
./.github/workflows/builds.sh | ||
shell: bash | ||
- name: Tag | ||
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
git config --global user.name 'Github actions auto build packages' | ||
git config --global user.email '[email protected]' | ||
chmod +x ./.github/workflows/builds.sh | ||
./.github/workflows/builds.sh | ||
git tag -a v1 -m "v1" | ||
git push origin --tags | ||
shell: bash | ||
if: github.event_name == 'push' | ||
uses: actions/github-script@v3 | ||
with: | ||
github-token: ${{ github.token }} | ||
script: | | ||
github.git.deleteRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "tags/built_apps" | ||
}) | ||
github.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/built_apps", | ||
sha: context.sha | ||
}) | ||
- name: Publish | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
uses: softprops/action-gh-release@v1 | ||
if: github.event_name == 'push' | ||
uses: ncipollo/release-action@v1 | ||
# TODO: if any of the build step fails, the release should be deleted. | ||
with: | ||
files: 'built_apps/*' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
artifacts: 'built_apps/*' | ||
tag: "built_apps" | ||
token: ${{ secrets.TOKEN }} |