|
6 | 6 | name: Build Anki deck |
7 | 7 | runs-on: ubuntu-latest |
8 | 8 | steps: |
9 | | - - uses: actions/checkout@master |
10 | | - - name: Set up Python 3.9 |
11 | | - uses: actions/setup-python@v1 |
| 9 | + - uses: actions/checkout@v4 |
| 10 | + - name: Set up Python 3.11 |
| 11 | + uses: actions/setup-python@v5 |
12 | 12 | with: |
13 | | - python-version: 3.9 |
| 13 | + python-version: "3.11" |
14 | 14 | - name: Install requirements |
15 | 15 | run: pip install -r requirements.txt |
16 | 16 | - name: Install sqlite |
17 | 17 | run: sudo apt-get install sqlite3 unzip |
18 | 18 | - name: Get current date |
19 | 19 | id: date |
20 | | - run: echo "::set-output name=date::$(date +'%Y-%m-%d_%H:%M:%S')" |
| 20 | + run: echo "date=$(date +'%Y-%m-%d_%H:%M:%S')" >> "$GITHUB_OUTPUT" |
21 | 21 | - name: Get current timestamp |
22 | 22 | id: timestamp |
23 | | - run: echo "::set-output name=timestamp::$(date +'%s')" |
| 23 | + run: echo "timestamp=$(date +'%s')" >> "$GITHUB_OUTPUT" |
24 | 24 | - name: Test build Anki Deck |
25 | 25 | run: > |
26 | 26 | git clean -f -x -d |
@@ -52,23 +52,15 @@ jobs: |
52 | 52 | env: |
53 | 53 | LEETCODE_SESSION_ID: ${{ secrets.LEETCODE_SESSION_ID }} |
54 | 54 | LEETCODE_CSRF_TOKEN: ${{ secrets.LEETCODE_CSRF_TOKEN }} |
55 | | - - name: Create Release |
56 | | - id: create_release |
57 | | - uses: actions/create-release@v1 |
58 | | - env: |
59 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + - name: Create Release and Upload Asset |
| 56 | + uses: softprops/action-gh-release@v2 |
| 57 | + if: github.ref == 'refs/heads/master' |
60 | 58 | with: |
61 | | - tag_name: ${{ github.ref }}-${{ steps.timestamp.outputs.timestamp }} |
62 | | - release_name: > |
| 59 | + tag_name: ${{ github.ref_name }}-${{ steps.timestamp.outputs.timestamp }} |
| 60 | + name: > |
63 | 61 | Anki Deck from ${{ github.ref }} on ${{ steps.date.outputs.date }} |
64 | 62 | draft: true |
65 | 63 | prerelease: true |
66 | | - - name: Upload release asset |
67 | | - uses: actions/upload-release-asset@v1 |
| 64 | + files: ./leetcode.apkg |
68 | 65 | env: |
69 | 66 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
70 | | - with: |
71 | | - upload_url: ${{ steps.create_release.outputs.upload_url }} |
72 | | - asset_path: ./leetcode.apkg |
73 | | - asset_name: leetcode.apkg |
74 | | - asset_content_type: application/octet-stream |
0 commit comments