Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Github release CI code #1883

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,19 @@ jobs:
echo ${{ secrets.KEYSTORE_BASE64 }} | base64 --decode > keystore.jks
$ANDROID_HOME/build-tools/29.0.3/apksigner sign --ks keystore.jks --ks-pass 'pass:${{ secrets.KEYSTORE_PASSPHRASE }}' --key-pass 'pass:${{ secrets.KEY_PASSPHRASE }}' --out $GITHUB_WORKSPACE/andbible-$TAG_NAME.apk app-github-release-unsigned.apk
rm -f keystore.jks

- name: Create release
if: contains(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
uses: softprops/action-gh-release@v1
Copy link
Contributor

@tuomas2 tuomas2 Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@6034af24fba4e5a8e975aaa6056554efe4c794d0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we trust this author? I feel a bit scared always using these third-party modules that have minified js code... almost would like to build code myself from source and review code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It was one of the 4 actions recommended from Github's action repo. It was the one with most stars and forks, and looks like it's being constantly maintained.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pity that Github does not take responsibility of maintaining this kind of useful basic tools...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just seeing that the source files are TypeScript. Isn't the minified js file just TypeScript processed? We could quite easily fork and do that process ourselves I think

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ steps.tag_name.outputs.TAG }}
VERSION_NAME: ${{ steps.tag_name.outputs.VERSION_NAME }}
RELEASE_TITLE: ${{ steps.tag_name.outputs.RELEASE_TITLE }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.RELEASE_TITLE }}
name: ${{ env.RELEASE_TITLE }}
body_path: ./RELEASENOTES.txt
files: ./andbible-${{ env.TAG_NAME }}.apk
prerelease: true

- name: Upload Release Apk
if: contains(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ steps.tag_name.outputs.TAG }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./andbible-${{ env.TAG_NAME }}.apk
asset_name: andbible-${{ env.TAG_NAME }}.apk
asset_content_type: application/vnd.android.package-archive

- name: Before saving cache
run: |
rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
Expand Down