Skip to content

Commit

Permalink
feat: create release on tag using GitHub actions (#19)
Browse files Browse the repository at this point in the history
* build: add build actions

* build: add release on tag

* build: allow updates to already present release

* build: update release name and body

* chore: add release instructions to readme

* chore: update name
  • Loading branch information
jatindotdev authored Dec 20, 2023
1 parent 41329b3 commit 86a1f3c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 11 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.16.4"
cache: true

- run: flutter pub get
- run: flutter build apk

- name: Release APK
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
allowUpdates: true
name: "KzShortner ${{ github.ref_name }}"
body: "Check the assets for the APK."
artifacts: "build/app/outputs/apk/release/*.apk"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# kzlinks
# KzShortner

A new Flutter project.
Shorten the URL. Broaden the reach.

## Getting Started
## How to create a release

This project is a starting point for a Flutter application.
> Make sure a Personal Access Token with access to `contents` with `access-read-write` added to repository secrets with name `TOKEN`
A few resources to get you started if this is your first Flutter project:
```bash
git tag v0.1.0 # Create a tag and should be prefixed with v_ for eg. v1.0
```

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
```bash
git push v0.1.0
```

0 comments on commit 86a1f3c

Please sign in to comment.