Skip to content

Commit

Permalink
Ubah Lagi
Browse files Browse the repository at this point in the history
  • Loading branch information
QiubyZ committed Sep 11, 2024
1 parent 18a8202 commit eb19e21
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,25 @@ To run this reusable script, you need to give permissions as in the example in t
# Guide
It's quite simple to use,

```bash
```yaml
name: Android Release

on:
push:
brances: [ main ]

env:
GITHUB_ACTION: ${{secret.GITHUB_ACTION}}
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
uses: QiubyZ/apk-autorelease@v1
```
steps:
- uses: actions/checkout@v3

- uses: QiubyZ/apk-autorelease@v1
with:
gradle_cmd: 'assembleDebug' # this is will write apk filename /app-release-unsigned.apk
tag: 'Production'
body_release: 'Aplikasi versi produksi dirilis.'
file_output: './app/build/outputs/apk/debug/app-debug.apk'
```
or you can see how this script is called in the Repository that I have shown in the example [See examples here](https://github.com/QiubyZ/ExecutorService/blob/main/.github/workflows/main.yml)
19 changes: 19 additions & 0 deletions delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

username="QiubyZ" # Ganti dengan username GitHub kamu
repository="apk-autorelease" # Ganti dengan nama repository kamu

gh api graphql -F username="$username" -F reponame="$repository" -f '
query($username: String!, $reponame: String!) {
repository(owner: $username, name: $reponame) {
refs(refPrefix: "refs/tags/", first: 100) {
nodes {
name
}
}
}
}
' --jq '.data.repository.refs.nodes[].name' | while read -r tag; do
gh tag delete --force "$tag"
echo "Tag '$tag' berhasil dihapus."
done
26 changes: 26 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import requests

# Ganti dengan informasi Anda
username = "QiubyZ"
repo = "apk-autorelease"
token = "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"

headers = {"Authorization": f"token {token}"}

# Hapus semua rilis
releases_url = f"https://api.github.com/repos/{username}/{repo}/releases"
releases = requests.get(releases_url, headers=headers).json()
for release in releases:
release_id = release["id"]
delete_url = f"https://api.github.com/repos/{username}/{repo}/releases/{release_id}"
requests.delete(delete_url, headers=headers)

# Hapus semua tag
tags_url = f"https://api.github.com/repos/{username}/{repo}/tags"
tags = requests.get(tags_url, headers=headers).json()
for tag in tags:
tag_name = tag["name"]
delete_url = f"https://api.github.com/repos/{username}/{repo}/git/refs/tags/{tag_name}"
requests.delete(delete_url, headers=headers)

print("Semua rilis dan tag telah dihapus.")

0 comments on commit eb19e21

Please sign in to comment.